dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "SpecialUserlogin: Error out when attempting to create a username with a '#'"
[lhc/web/wiklou.git]
/
includes
/
HtmlFormatter.php
diff --git
a/includes/HtmlFormatter.php
b/includes/HtmlFormatter.php
index
83d0530
..
987a683
100644
(file)
--- a/
includes/HtmlFormatter.php
+++ b/
includes/HtmlFormatter.php
@@
-136,7
+136,13
@@
class HtmlFormatter {
wfProfileIn( __METHOD__ );
$removals = $this->parseItemsToRemove();
wfProfileIn( __METHOD__ );
$removals = $this->parseItemsToRemove();
- if ( !$removals ) {
+ // Bail out early if nothing to do
+ if ( array_reduce( $removals,
+ function( $carry, $item ) {
+ return $carry && !$item;
+ },
+ true
+ ) ) {
wfProfileOut( __METHOD__ );
return array();
}
wfProfileOut( __METHOD__ );
return array();
}
@@
-287,11
+293,12
@@
class HtmlFormatter {
// XML code paths if possible and fix there.
$html = str_replace( ' ', '', $html );
}
// XML code paths if possible and fix there.
$html = str_replace( ' ', '', $html );
}
- $html = preg_replace( '/<!--.*?-->|^.*?<body>|<\/body>.*$/s', '', $html );
wfProfileOut( __METHOD__ . '-fixes' );
} else {
$html = $this->html;
}
wfProfileOut( __METHOD__ . '-fixes' );
} else {
$html = $this->html;
}
+ // Remove stuff added by wrapHTML()
+ $html = preg_replace( '/<!--.*?-->|^.*?<body>|<\/body>.*$/s', '', $html );
$html = $this->onHtmlReady( $html );
wfProfileIn( __METHOD__ . '-flatten' );
$html = $this->onHtmlReady( $html );
wfProfileIn( __METHOD__ . '-flatten' );