Skip to content

Commit

Permalink
Escape the backslash in function_exists for WP_Filesystem to actually…
Browse files Browse the repository at this point in the history
… check for it in the global namespace.
  • Loading branch information
Mark George authored and seear committed Oct 28, 2019
1 parent e089413 commit cf2b048
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bin/phpcs-whitelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module.exports = [
'_inc/lib/core-api/wpcom-endpoints/memberships.php',
'_inc/lib/debugger/',
'_inc/lib/plans.php',
'json-endpoints/jetpack/class.jetpack-json-api-delete-backup-helper-script.php',
'json-endpoints/jetpack/class.jetpack-json-api-install-backup-helper-script.php',
'json-endpoints/jetpack/class-jetpack-json-api-delete-backup-helper-script.php',
'json-endpoints/jetpack/class-jetpack-json-api-install-backup-helper-script.php',
'load-jetpack.php',
'modules/masterbar/',
'modules/memberships/',
Expand Down
4 changes: 2 additions & 2 deletions packages/backup/src/Helper_Script_Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ private static function write_supplementary_temp_files( $dir ) {
private static function put_contents( $file_path, $contents ) {
global $wp_filesystem;

if ( ! function_exists( '\WP_Filesystem' ) ) {
if ( ! function_exists( '\\WP_Filesystem' ) ) {
require_once ABSPATH . 'wp-admin/includes/file.php';
}

Expand All @@ -298,7 +298,7 @@ private static function put_contents( $file_path, $contents ) {
private static function verify_file_header( $file_path, $expected_header ) {
global $wp_filesystem;

if ( ! function_exists( '\WP_Filesystem' ) ) {
if ( ! function_exists( '\\WP_Filesystem' ) ) {
require_once ABSPATH . 'wp-admin/includes/file.php';
}

Expand Down

0 comments on commit cf2b048

Please sign in to comment.