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
Normalize PHPDoc attributes
[lhc/web/wiklou.git]
/
includes
/
parser
/
Sanitizer.php
diff --git
a/includes/parser/Sanitizer.php
b/includes/parser/Sanitizer.php
index
b570a43
..
b13e597
100644
(file)
--- a/
includes/parser/Sanitizer.php
+++ b/
includes/parser/Sanitizer.php
@@
-515,9
+515,9
@@
class Sanitizer {
$badtag = true;
} elseif ( $slash ) {
# Closing a tag... is it the one we just opened?
$badtag = true;
} elseif ( $slash ) {
# Closing a tag... is it the one we just opened?
-
MediaWiki
\suppressWarnings();
+
Wikimedia
\suppressWarnings();
$ot = array_pop( $tagstack );
$ot = array_pop( $tagstack );
-
MediaWiki
\restoreWarnings();
+
Wikimedia
\restoreWarnings();
if ( $ot != $t ) {
if ( isset( $htmlsingleallowed[$ot] ) ) {
if ( $ot != $t ) {
if ( isset( $htmlsingleallowed[$ot] ) ) {
@@
-525,32
+525,32
@@
class Sanitizer {
# and see if we find a match below them
$optstack = [];
array_push( $optstack, $ot );
# and see if we find a match below them
$optstack = [];
array_push( $optstack, $ot );
-
MediaWiki
\suppressWarnings();
+
Wikimedia
\suppressWarnings();
$ot = array_pop( $tagstack );
$ot = array_pop( $tagstack );
-
MediaWiki
\restoreWarnings();
+
Wikimedia
\restoreWarnings();
while ( $ot != $t && isset( $htmlsingleallowed[$ot] ) ) {
array_push( $optstack, $ot );
while ( $ot != $t && isset( $htmlsingleallowed[$ot] ) ) {
array_push( $optstack, $ot );
-
MediaWiki
\suppressWarnings();
+
Wikimedia
\suppressWarnings();
$ot = array_pop( $tagstack );
$ot = array_pop( $tagstack );
-
MediaWiki
\restoreWarnings();
+
Wikimedia
\restoreWarnings();
}
if ( $t != $ot ) {
# No match. Push the optional elements back again
$badtag = true;
}
if ( $t != $ot ) {
# No match. Push the optional elements back again
$badtag = true;
-
MediaWiki
\suppressWarnings();
+
Wikimedia
\suppressWarnings();
$ot = array_pop( $optstack );
$ot = array_pop( $optstack );
-
MediaWiki
\restoreWarnings();
+
Wikimedia
\restoreWarnings();
while ( $ot ) {
array_push( $tagstack, $ot );
while ( $ot ) {
array_push( $tagstack, $ot );
-
MediaWiki
\suppressWarnings();
+
Wikimedia
\suppressWarnings();
$ot = array_pop( $optstack );
$ot = array_pop( $optstack );
-
MediaWiki
\restoreWarnings();
+
Wikimedia
\restoreWarnings();
}
}
} else {
}
}
} else {
-
MediaWiki
\suppressWarnings();
+
Wikimedia
\suppressWarnings();
array_push( $tagstack, $ot );
array_push( $tagstack, $ot );
-
MediaWiki
\restoreWarnings();
+
Wikimedia
\restoreWarnings();
# <li> can be nested in <ul> or <ol>, skip those cases:
if ( !isset( $htmllist[$ot] ) || !isset( $listtags[$t] ) ) {
# <li> can be nested in <ul> or <ol>, skip those cases:
if ( !isset( $htmllist[$ot] ) || !isset( $listtags[$t] ) ) {
@@
-1171,7
+1171,9
@@
class Sanitizer {
# Stupid hack
$encValue = preg_replace_callback(
'/((?i)' . wfUrlProtocols() . ')/',
# Stupid hack
$encValue = preg_replace_callback(
'/((?i)' . wfUrlProtocols() . ')/',
- [ 'Sanitizer', 'armorLinksCallback' ],
+ function ( $matches ) {
+ return str_replace( ':', ':', $matches[1] );
+ },
$encValue );
return $encValue;
}
$encValue );
return $encValue;
}
@@
-1416,15
+1418,6
@@
class Sanitizer {
return $html;
}
return $html;
}
- /**
- * Regex replace callback for armoring links against further processing.
- * @param array $matches
- * @return string
- */
- private static function armorLinksCallback( $matches ) {
- return str_replace( ':', ':', $matches[1] );
- }
-
/**
* Return an associative array of attribute names and values from
* a partial tag string. Attribute names are forced to lowercase,
/**
* Return an associative array of attribute names and values from
* a partial tag string. Attribute names are forced to lowercase,
@@
-1549,7
+1542,7
@@
class Sanitizer {
static function normalizeCharReferences( $text ) {
return preg_replace_callback(
self::CHAR_REFS_REGEX,
static function normalizeCharReferences( $text ) {
return preg_replace_callback(
self::CHAR_REFS_REGEX,
- [
'Sanitizer'
, 'normalizeCharReferencesCallback' ],
+ [
self::class
, 'normalizeCharReferencesCallback' ],
$text );
}
$text );
}
@@
-1649,7
+1642,7
@@
class Sanitizer {
public static function decodeCharReferences( $text ) {
return preg_replace_callback(
self::CHAR_REFS_REGEX,
public static function decodeCharReferences( $text ) {
return preg_replace_callback(
self::CHAR_REFS_REGEX,
- [
'Sanitizer'
, 'decodeCharReferencesCallback' ],
+ [
self::class
, 'decodeCharReferencesCallback' ],
$text );
}
$text );
}
@@
-1667,7
+1660,7
@@
class Sanitizer {
global $wgContLang;
$text = preg_replace_callback(
self::CHAR_REFS_REGEX,
global $wgContLang;
$text = preg_replace_callback(
self::CHAR_REFS_REGEX,
- [
'Sanitizer'
, 'decodeCharReferencesCallback' ],
+ [
self::class
, 'decodeCharReferencesCallback' ],
$text,
-1, //limit
$count
$text,
-1, //limit
$count