PHP4 compatibility for files loaded before we bail. fixes #25760.

git-svn-id: https://develop.svn.wordpress.org/trunk@25986 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-10-29 20:05:16 +00:00
parent e575c315fb
commit 1cce2a89fd
2 changed files with 4 additions and 4 deletions

View File

@ -42,10 +42,10 @@ function wp_initial_constants() {
if ( function_exists( 'memory_get_usage' ) ) { if ( function_exists( 'memory_get_usage' ) ) {
$current_limit = @ini_get( 'memory_limit' ); $current_limit = @ini_get( 'memory_limit' );
$current_limit_int = intval( $current_limit ); $current_limit_int = intval( $current_limit );
if ( false !== stripos( $current_limit, 'G' ) ) if ( false !== strpos( $current_limit, 'G' ) )
$current_limit_int *= 1024; $current_limit_int *= 1024;
$wp_limit_int = intval( WP_MEMORY_LIMIT ); $wp_limit_int = intval( WP_MEMORY_LIMIT );
if ( false !== stripos( WP_MEMORY_LIMIT, 'G' ) ) if ( false !== strpos( WP_MEMORY_LIMIT, 'G' ) )
$wp_limit_int *= 1024; $wp_limit_int *= 1024;
if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || $current_limit_int < $wp_limit_int ) ) if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || $current_limit_int < $wp_limit_int ) )

View File

@ -797,9 +797,9 @@ function wp_get_pomo_file_data( $po_file ) {
'Project-Id-Version' => '"Project-Id-Version', 'Project-Id-Version' => '"Project-Id-Version',
'X-Generator' => '"X-Generator', 'X-Generator' => '"X-Generator',
) ); ) );
foreach ( $headers as &$header ) { foreach ( $headers as $header => $value ) {
// Remove possible contextual '\n' and closing double quote. // Remove possible contextual '\n' and closing double quote.
$header = preg_replace( '~(\\\n)?"$~', '', $header ); $headers[ $header ] = preg_replace( '~(\\\n)?"$~', '', $value );
} }
return $headers; return $headers;
} }