Skip to content

Commit

Permalink
Look for if ( SHORTINIT ) and then skip to after the next two \n.
Browse files Browse the repository at this point in the history
Instead of searching for "// Load the l18n library"
  • Loading branch information
kayue committed May 24, 2012
1 parent a5ef2f4 commit 803032a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions init.php
Expand Up @@ -49,9 +49,10 @@ function wp_tests_options( $value ) {

// Load the rest of wp-settings.php, start from where we left off.
$wp_settings_content = file_get_contents(ABSPATH.'/wp-settings.php');
$offset = strpos($wp_settings_content, '// Load the l18n library.');
$shortinit_phrase = "if ( SHORTINIT )\n\treturn false;\n";
$offset = strpos($wp_settings_content, $shortinit_phrase)+strlen($shortinit_phrase);
eval(substr($wp_settings_content, $offset));
unset($wp_settings_content, $offset);
unset($wp_settings_content, $offset, $shortinit_phrase);

require dirname( __FILE__ ) . '/lib/testcase.php';
require dirname( __FILE__ ) . '/lib/exceptions.php';

0 comments on commit 803032a

Please sign in to comment.