Skip to content

WordPress.WP.AlternativeFunctions.file_system_read_fclose should be silenced #640

@rebeccahum

Description

@rebeccahum

We can silence the error code WordPress.WP.AlternativeFunctions.file_system_read_fclose since it's redundant, as the error is already triggered when fopen() is called:

<rule ref="WordPress.WP.AlternativeFunctions.file_system_read_fopen">
<message>File system operations only work on the `/tmp/` and `wp-content/uploads/` directories. To avoid unexpected results, please use helper functions like `get_temp_dir()` or `wp_get_upload_dir()` to get the proper directory path when using functions such as %s(). For more details, please see: https://docs.wpvip.com/technical-references/vip-go-files-system/local-file-operations/</message>
</rule>

Two things:

  • remove the custom error message here:
    <rule ref="WordPress.WP.AlternativeFunctions.file_system_read_fclose">
    <message>File system operations only work on the `/tmp/` and `wp-content/uploads/` directories. To avoid unexpected results, please use helper functions like `get_temp_dir()` or `wp_get_upload_dir()` to get the proper directory path when using functions such as %s(). For more details, please see: https://docs.wpvip.com/technical-references/vip-go-files-system/local-file-operations/</message>
    </rule>
  • silence the error code since it's being inherited at the WordPressVIPMinimum level:
    <rule ref="WordPress.WP.AlternativeFunctions">

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions