Rewrite Rules: Remove redundant `if` condition in `extract_from_markers()`.

Props Dency, yahil, appchecker.
Fixes #39920.
Built from https://develop.svn.wordpress.org/trunk@41928


git-svn-id: http://core.svn.wordpress.org/trunk@41762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2017-10-18 21:28:46 +00:00
parent 0afafb7a1b
commit 0f06f90341
2 changed files with 12 additions and 10 deletions

View File

@ -67,20 +67,22 @@ function got_url_rewrite() {
function extract_from_markers( $filename, $marker ) { function extract_from_markers( $filename, $marker ) {
$result = array (); $result = array ();
if (!file_exists( $filename ) ) { if ( ! file_exists( $filename ) ) {
return $result; return $result;
} }
if ( $markerdata = explode( "\n", implode( '', file( $filename ) ) )); $markerdata = explode( "\n", implode( '', file( $filename ) ) );
{
$state = false; $state = false;
foreach ( $markerdata as $markerline ) { foreach ( $markerdata as $markerline ) {
if (strpos($markerline, '# END ' . $marker) !== false) if ( false !== strpos( $markerline, '# END ' . $marker ) ) {
$state = false; $state = false;
if ( $state ) if ( $state ) {
$result[] = $markerline; $result[] = $markerline;
if (strpos($markerline, '# BEGIN ' . $marker) !== false) }
if ( false !== strpos( $markerline, '# BEGIN ' . $marker ) ) {
$state = true; $state = true;
}
} }
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.9-beta2-41927'; $wp_version = '4.9-beta2-41928';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.