mirror of
git://develop.git.wordpress.org/
synced 2025-02-12 02:44:22 +01:00
Rewrite Rules: Remove redundant if
condition in extract_from_markers()
.
Props Dency, yahil, appchecker. Fixes #39920. git-svn-id: https://develop.svn.wordpress.org/trunk@41928 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6426b0b400
commit
40706838a1
@ -67,20 +67,22 @@ function got_url_rewrite() {
|
||||
function extract_from_markers( $filename, $marker ) {
|
||||
$result = array ();
|
||||
|
||||
if (!file_exists( $filename ) ) {
|
||||
if ( ! file_exists( $filename ) ) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if ( $markerdata = explode( "\n", implode( '', file( $filename ) ) ));
|
||||
{
|
||||
$state = false;
|
||||
foreach ( $markerdata as $markerline ) {
|
||||
if (strpos($markerline, '# END ' . $marker) !== false)
|
||||
$state = false;
|
||||
if ( $state )
|
||||
$markerdata = explode( "\n", implode( '', file( $filename ) ) );
|
||||
|
||||
$state = false;
|
||||
foreach ( $markerdata as $markerline ) {
|
||||
if ( false !== strpos( $markerline, '# END ' . $marker ) ) {
|
||||
$state = false;
|
||||
if ( $state ) {
|
||||
$result[] = $markerline;
|
||||
if (strpos($markerline, '# BEGIN ' . $marker) !== false)
|
||||
}
|
||||
if ( false !== strpos( $markerline, '# BEGIN ' . $marker ) ) {
|
||||
$state = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user