Index: src/wp-includes/compat.php
===================================================================
--- src/wp-includes/compat.php	(revision 25973)
+++ src/wp-includes/compat.php	(working copy)
@@ -32,6 +32,12 @@
 	return implode( '', $chars );
 }
 
+if ( ! function_exists( 'stripos' ) ) {
+	function stripos( $haystack, $needle, $offset = 0 ) {
+		return strpos( strtolower( $haystack ), strtolower( $needle ), $offset );
+	}
+}
+
 if ( !function_exists('hash_hmac') ):
 function hash_hmac($algo, $data, $key, $raw_output = false) {
 	return _hash_hmac($algo, $data, $key, $raw_output);
Index: src/wp-includes/default-constants.php
===================================================================
--- src/wp-includes/default-constants.php	(revision 25973)
+++ src/wp-includes/default-constants.php	(working copy)
@@ -42,10 +42,11 @@
 	if ( function_exists( 'memory_get_usage' ) ) {
 		$current_limit = @ini_get( 'memory_limit' );
 		$current_limit_int = intval( $current_limit );
-		if ( false !== stripos( $current_limit, 'G' ) )
+		// Avoid stripos() so we can fail gracefully in PHP4.
+		if ( false !== strpos( strtoupper( $current_limit ), 'G' ) )
 			$current_limit_int *= 1024;
 		$wp_limit_int = intval( WP_MEMORY_LIMIT );
-		if ( false !== stripos( WP_MEMORY_LIMIT, 'G' ) )
+		if ( false !== strpos( strtoupper( WP_MEMORY_LIMIT ), 'G' ) )
 			$wp_limit_int *= 1024;
 
 		if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || $current_limit_int < $wp_limit_int ) )
