Coding Standards: Use strict comparison in `wp-admin/includes/class-wp-filesystem-*.php`.
See #52627. Built from https://develop.svn.wordpress.org/trunk@50657 git-svn-id: http://core.svn.wordpress.org/trunk@50269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
10a084a067
commit
a338f84f32
|
@ -274,7 +274,7 @@ class WP_Filesystem_Base {
|
|||
$files = $this->dirlist( $base );
|
||||
|
||||
foreach ( $folder_parts as $index => $key ) {
|
||||
if ( $index == $last_index ) {
|
||||
if ( $index === $last_index ) {
|
||||
continue; // We want this to be caught by the next code block.
|
||||
}
|
||||
|
||||
|
@ -343,19 +343,19 @@ class WP_Filesystem_Base {
|
|||
public function gethchmod( $file ) {
|
||||
$perms = intval( $this->getchmod( $file ), 8 );
|
||||
|
||||
if ( ( $perms & 0xC000 ) == 0xC000 ) { // Socket.
|
||||
if ( ( $perms & 0xC000 ) === 0xC000 ) { // Socket.
|
||||
$info = 's';
|
||||
} elseif ( ( $perms & 0xA000 ) == 0xA000 ) { // Symbolic Link.
|
||||
} elseif ( ( $perms & 0xA000 ) === 0xA000 ) { // Symbolic Link.
|
||||
$info = 'l';
|
||||
} elseif ( ( $perms & 0x8000 ) == 0x8000 ) { // Regular.
|
||||
} elseif ( ( $perms & 0x8000 ) === 0x8000 ) { // Regular.
|
||||
$info = '-';
|
||||
} elseif ( ( $perms & 0x6000 ) == 0x6000 ) { // Block special.
|
||||
} elseif ( ( $perms & 0x6000 ) === 0x6000 ) { // Block special.
|
||||
$info = 'b';
|
||||
} elseif ( ( $perms & 0x4000 ) == 0x4000 ) { // Directory.
|
||||
} elseif ( ( $perms & 0x4000 ) === 0x4000 ) { // Directory.
|
||||
$info = 'd';
|
||||
} elseif ( ( $perms & 0x2000 ) == 0x2000 ) { // Character special.
|
||||
} elseif ( ( $perms & 0x2000 ) === 0x2000 ) { // Character special.
|
||||
$info = 'c';
|
||||
} elseif ( ( $perms & 0x1000 ) == 0x1000 ) { // FIFO pipe.
|
||||
} elseif ( ( $perms & 0x1000 ) === 0x1000 ) { // FIFO pipe.
|
||||
$info = 'p';
|
||||
} else { // Unknown.
|
||||
$info = 'u';
|
||||
|
|
|
@ -505,11 +505,11 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
|||
* @return bool True on success, false on failure.
|
||||
*/
|
||||
public function touch( $file, $time = 0, $atime = 0 ) {
|
||||
if ( 0 == $time ) {
|
||||
if ( 0 === $time ) {
|
||||
$time = time();
|
||||
}
|
||||
|
||||
if ( 0 == $atime ) {
|
||||
if ( 0 === $atime ) {
|
||||
$atime = time();
|
||||
}
|
||||
|
||||
|
@ -630,7 +630,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
|||
continue;
|
||||
}
|
||||
|
||||
if ( $limit_file && $struc['name'] != $limit_file ) {
|
||||
if ( $limit_file && $struc['name'] !== $limit_file ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -450,7 +450,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
|||
$cwd = $this->cwd();
|
||||
$result = @ftp_chdir( $this->link, trailingslashit( $path ) );
|
||||
|
||||
if ( $result && $path == $this->cwd() || $this->cwd() != $cwd ) {
|
||||
if ( $result && $path === $this->cwd() || $this->cwd() !== $cwd ) {
|
||||
@ftp_chdir( $this->link, $cwd );
|
||||
return true;
|
||||
}
|
||||
|
@ -614,7 +614,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
|||
$b['year'] = $lucifer[3];
|
||||
$b['hour'] = $lucifer[4];
|
||||
$b['minute'] = $lucifer[5];
|
||||
$b['time'] = mktime( $lucifer[4] + ( strcasecmp( $lucifer[6], 'PM' ) == 0 ? 12 : 0 ), $lucifer[5], 0, $lucifer[1], $lucifer[2], $lucifer[3] );
|
||||
$b['time'] = mktime( $lucifer[4] + ( strcasecmp( $lucifer[6], 'PM' ) === 0 ? 12 : 0 ), $lucifer[5], 0, $lucifer[1], $lucifer[2], $lucifer[3] );
|
||||
$b['am/pm'] = $lucifer[6];
|
||||
$b['name'] = $lucifer[8];
|
||||
} elseif ( ! $is_windows ) {
|
||||
|
@ -647,7 +647,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
|||
$b['group'] = $lucifer[3];
|
||||
$b['size'] = $lucifer[4];
|
||||
|
||||
if ( 8 == $lcount ) {
|
||||
if ( 8 === $lcount ) {
|
||||
sscanf( $lucifer[5], '%d-%d-%d', $b['year'], $b['month'], $b['day'] );
|
||||
sscanf( $lucifer[6], '%d:%d', $b['hour'], $b['minute'] );
|
||||
|
||||
|
@ -745,7 +745,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
|||
continue;
|
||||
}
|
||||
|
||||
if ( $limit_file && $entry['name'] != $limit_file ) {
|
||||
if ( $limit_file && $entry['name'] !== $limit_file ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -210,7 +210,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
|||
|
||||
$bytes_written = fwrite( $temphandle, $contents );
|
||||
|
||||
if ( false === $bytes_written || strlen( $contents ) != $bytes_written ) {
|
||||
if ( false === $bytes_written || strlen( $contents ) !== $bytes_written ) {
|
||||
fclose( $temphandle );
|
||||
unlink( $tempfile );
|
||||
|
||||
|
@ -650,7 +650,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
|||
continue;
|
||||
}
|
||||
|
||||
if ( $limit_file && $struc['name'] != $limit_file ) {
|
||||
if ( $limit_file && $struc['name'] !== $limit_file ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -779,7 +779,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
|||
continue;
|
||||
}
|
||||
|
||||
if ( $limit_file && $struc['name'] != $limit_file ) {
|
||||
if ( $limit_file && $struc['name'] !== $limit_file ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.8-alpha-50654';
|
||||
$wp_version = '5.8-alpha-50657';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue