WordPress.org

Make WordPress Core

Changeset 41928


Ignore:
Timestamp:
10/18/2017 09:27:22 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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

Props Dency, yahil, appchecker.
Fixes #39920.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/misc.php

    r41851 r41928  
    6868    $result = array ();
    6969
    70     if (!file_exists( $filename ) ) {
     70    if ( ! file_exists( $filename ) ) {
    7171        return $result;
    7272    }
    7373
    74     if ( $markerdata = explode( "\n", implode( '', file( $filename ) ) ));
    75     {
    76         $state = false;
    77         foreach ( $markerdata as $markerline ) {
    78             if (strpos($markerline, '# END ' . $marker) !== false)
    79                 $state = false;
    80             if ( $state )
     74    $markerdata = explode( "\n", implode( '', file( $filename ) ) );
     75
     76    $state = false;
     77    foreach ( $markerdata as $markerline ) {
     78        if ( false !== strpos( $markerline, '# END ' . $marker ) ) {
     79            $state = false;
     80            if ( $state ) {
    8181                $result[] = $markerline;
    82             if (strpos($markerline, '# BEGIN ' . $marker) !== false)
     82            }
     83            if ( false !== strpos( $markerline, '# BEGIN ' . $marker ) ) {
    8384                $state = true;
     85            }
    8486        }
    8587    }
Note: See TracChangeset for help on using the changeset viewer.