Changeset 56245 for trunk/src/wp-includes/load.php
- Timestamp:
- 07/17/2023 01:16:14 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/load.php
r56238 r56245 76 76 77 77 // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests. 78 if ( isset( $_SERVER['SCRIPT_FILENAME'] ) 79 && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) === strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) 80 ) { 78 if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && str_ends_with( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) ) { 81 79 $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; 82 80 } 83 81 84 82 // Fix for Dreamhost and other PHP as CGI hosts. 85 if ( isset( $_SERVER['SCRIPT_NAME'] ) && ( strpos( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) !== false) ) {83 if ( isset( $_SERVER['SCRIPT_NAME'] ) && str_contains( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) ) { 86 84 unset( $_SERVER['PATH_INFO'] ); 87 85 } … … 938 936 939 937 while ( ( $plugin = readdir( $dh ) ) !== false ) { 940 if ( '.php' === substr( $plugin, -4) ) {938 if ( str_ends_with( $plugin, '.php' ) ) { 941 939 $mu_plugins[] = WPMU_PLUGIN_DIR . '/' . $plugin; 942 940 } … … 982 980 foreach ( $active_plugins as $plugin ) { 983 981 if ( ! validate_file( $plugin ) // $plugin must validate as file. 984 && '.php' === substr( $plugin, -4) // $plugin must end with '.php'.982 && str_ends_with( $plugin, '.php' ) // $plugin must end with '.php'. 985 983 && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist. 986 984 // Not already included as a network plugin. … … 1618 1616 $bytes = (int) $value; 1619 1617 1620 if ( false !== strpos( $value, 'g' ) ) {1618 if ( str_contains( $value, 'g' ) ) { 1621 1619 $bytes *= GB_IN_BYTES; 1622 } elseif ( false !== strpos( $value, 'm' ) ) {1620 } elseif ( str_contains( $value, 'm' ) ) { 1623 1621 $bytes *= MB_IN_BYTES; 1624 } elseif ( false !== strpos( $value, 'k' ) ) {1622 } elseif ( str_contains( $value, 'k' ) ) { 1625 1623 $bytes *= KB_IN_BYTES; 1626 1624 } … … 1909 1907 if ( isset( $_SERVER['HTTP_ACCEPT'] ) ) { 1910 1908 foreach ( $accepted as $type ) { 1911 if ( false !== strpos( $_SERVER['HTTP_ACCEPT'], $type ) ) {1909 if ( str_contains( $_SERVER['HTTP_ACCEPT'], $type ) ) { 1912 1910 return true; 1913 1911 }
Note: See TracChangeset
for help on using the changeset viewer.