Changeset 56065 for trunk/src/wp-includes/load.php
- Timestamp:
- 06/27/2023 02:20:18 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/load.php
r56042 r56065 74 74 75 75 // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests. 76 if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && str_ends_with( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) ) { 76 if ( isset( $_SERVER['SCRIPT_FILENAME'] ) 77 && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) === strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) 78 ) { 77 79 $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; 78 80 } 79 81 80 82 // Fix for Dreamhost and other PHP as CGI hosts. 81 if ( isset( $_SERVER['SCRIPT_NAME'] ) && str_contains( $_SERVER['SCRIPT_NAME'], 'php.cgi') ) {83 if ( isset( $_SERVER['SCRIPT_NAME'] ) && ( strpos( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) !== false ) ) { 82 84 unset( $_SERVER['PATH_INFO'] ); 83 85 } … … 878 880 } 879 881 while ( ( $plugin = readdir( $dh ) ) !== false ) { 880 if ( str_ends_with( $plugin, '.php') ) {882 if ( '.php' === substr( $plugin, -4 ) ) { 881 883 $mu_plugins[] = WPMU_PLUGIN_DIR . '/' . $plugin; 882 884 } … … 920 922 foreach ( $active_plugins as $plugin ) { 921 923 if ( ! validate_file( $plugin ) // $plugin must validate as file. 922 && str_ends_with( $plugin, '.php') // $plugin must end with '.php'.924 && '.php' === substr( $plugin, -4 ) // $plugin must end with '.php'. 923 925 && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist. 924 926 // Not already included as a network plugin. … … 1550 1552 $bytes = (int) $value; 1551 1553 1552 if ( str_contains( $value, 'g' ) ) {1554 if ( false !== strpos( $value, 'g' ) ) { 1553 1555 $bytes *= GB_IN_BYTES; 1554 } elseif ( str_contains( $value, 'm' ) ) {1556 } elseif ( false !== strpos( $value, 'm' ) ) { 1555 1557 $bytes *= MB_IN_BYTES; 1556 } elseif ( str_contains( $value, 'k' ) ) {1558 } elseif ( false !== strpos( $value, 'k' ) ) { 1557 1559 $bytes *= KB_IN_BYTES; 1558 1560 } … … 1833 1835 if ( isset( $_SERVER['HTTP_ACCEPT'] ) ) { 1834 1836 foreach ( $accepted as $type ) { 1835 if ( str_contains( $_SERVER['HTTP_ACCEPT'], $type ) ) {1837 if ( false !== strpos( $_SERVER['HTTP_ACCEPT'], $type ) ) { 1836 1838 return true; 1837 1839 }
Note: See TracChangeset
for help on using the changeset viewer.