Rewrite Rules: Correct the logic in `extract_from_markers()` after [41928].

Props stodorovic.
Fixes #42579. See #39920.

git-svn-id: https://develop.svn.wordpress.org/trunk@42199 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2017-11-16 13:24:57 +00:00
parent aec1fb9aa0
commit 603e195f10
1 changed files with 6 additions and 6 deletions

View File

@ -77,12 +77,12 @@ function extract_from_markers( $filename, $marker ) {
foreach ( $markerdata as $markerline ) {
if ( false !== strpos( $markerline, '# END ' . $marker ) ) {
$state = false;
if ( $state ) {
$result[] = $markerline;
}
if ( false !== strpos( $markerline, '# BEGIN ' . $marker ) ) {
$state = true;
}
}
if ( $state ) {
$result[] = $markerline;
}
if ( false !== strpos( $markerline, '# BEGIN ' . $marker ) ) {
$state = true;
}
}