X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FTidy.php;h=4994d3e0506895725791ee779760447422da4035;hb=cfdf23952dac41ac78dd97e670295098348604cd;hp=5cc1b0f43b58e3435e485cef9ea6e7b02b14c165;hpb=3158abd3517162205711488e079d06928848ec75;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/Tidy.php b/includes/parser/Tidy.php index 5cc1b0f43b..4994d3e050 100644 --- a/includes/parser/Tidy.php +++ b/includes/parser/Tidy.php @@ -68,9 +68,9 @@ class MWTidyWrapper { $wrappedtext = preg_replace( '!<(link|meta)([^>]*?)(/{0,1}>)!', ''. - 'test'.$wrappedtext.''; + $wrappedtext = '' . + 'test' . $wrappedtext . ''; return $wrappedtext; } @@ -260,24 +260,24 @@ class MWTidy { wfProfileOut( __METHOD__ ); return $tidy->errorBuffer; + } + + $tidy->cleanRepair(); + $retval = $tidy->getStatus(); + if ( $retval == 2 ) { + // 2 is magic number for fatal error + // http://www.php.net/manual/en/function.tidy-get-status.php + $cleansource = null; } else { - $tidy->cleanRepair(); - $retval = $tidy->getStatus(); - if ( $retval == 2 ) { - // 2 is magic number for fatal error - // http://www.php.net/manual/en/function.tidy-get-status.php - $cleansource = null; - } else { - $cleansource = tidy_get_output( $tidy ); - if ( $wgDebugTidy && $retval > 0 ) { - $cleansource .= "', '-->', $tidy->errorBuffer ) . - "\n-->"; - } + $cleansource = tidy_get_output( $tidy ); + if ( $wgDebugTidy && $retval > 0 ) { + $cleansource .= "', '-->', $tidy->errorBuffer ) . + "\n-->"; } - - wfProfileOut( __METHOD__ ); - return $cleansource; } + + wfProfileOut( __METHOD__ ); + return $cleansource; } }