Make WordPress Core

Ticket #25760: 25760.diff

File 25760.diff, 1.4 KB (added by nacin, 12 years ago)

One or the other

  • src/wp-includes/compat.php

     
    3232        return implode( '', $chars );
    3333}
    3434
     35if ( ! function_exists( 'stripos' ) ) {
     36        function stripos( $haystack, $needle, $offset = 0 ) {
     37                return strpos( strtolower( $haystack ), strtolower( $needle ), $offset );
     38        }
     39}
     40
    3541if ( !function_exists('hash_hmac') ):
    3642function hash_hmac($algo, $data, $key, $raw_output = false) {
    3743        return _hash_hmac($algo, $data, $key, $raw_output);
  • src/wp-includes/default-constants.php

     
    4242        if ( function_exists( 'memory_get_usage' ) ) {
    4343                $current_limit = @ini_get( 'memory_limit' );
    4444                $current_limit_int = intval( $current_limit );
    45                 if ( false !== stripos( $current_limit, 'G' ) )
     45                // Avoid stripos() so we can fail gracefully in PHP4.
     46                if ( false !== strpos( strtoupper( $current_limit ), 'G' ) )
    4647                        $current_limit_int *= 1024;
    4748                $wp_limit_int = intval( WP_MEMORY_LIMIT );
    48                 if ( false !== stripos( WP_MEMORY_LIMIT, 'G' ) )
     49                if ( false !== strpos( strtoupper( WP_MEMORY_LIMIT ), 'G' ) )
    4950                        $wp_limit_int *= 1024;
    5051
    5152                if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || $current_limit_int < $wp_limit_int ) )