Legoktm has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/381514 )
Change subject: Sanitizer: hard deprecate passing $options to
escapeIdReferenceList()
......................................................................
Sanitizer: hard deprecate passing $options to escapeIdReferenceList()
Change-Id: I22743102e75614bba848e09f032586923cef0f60
---
M includes/Sanitizer.php
M tests/phpunit/includes/SanitizerTest.php
2 files changed, 6 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/14/381514/1
diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php
index a7f963a..4c99677 100644
--- a/includes/Sanitizer.php
+++ b/includes/Sanitizer.php
@@ -824,7 +824,7 @@
|| $attribute === 'aria-labelledby'
|| $attribute === 'aria-owns'
) {
- $value = self::escapeIdReferenceList( $value,
'noninitial' );
+ $value = self::escapeIdReferenceList( $value );
}
// RDFa and microdata properties allow URLs, URIs
and/or CURIs.
@@ -1344,7 +1344,7 @@
* Given a string containing a space delimited list of ids, escape each
id
* to match ids escaped by the escapeId() function.
*
- * @todo wfDeprecated() uses of $options in 1.31, remove completely in
1.32
+ * @todo remove $options completely in 1.32
*
* @since 1.27
*
@@ -1353,6 +1353,9 @@
* @return string
*/
static function escapeIdReferenceList( $referenceString, $options = []
) {
+ if ( $options ) {
+ wfDeprecated( __METHOD__ . ' with $options', '1.31' );
+ }
# Explode the space delimited list string into an array of
tokens
$references = preg_split( '/\s+/', "{$referenceString}", -1,
PREG_SPLIT_NO_EMPTY );
diff --git a/tests/phpunit/includes/SanitizerTest.php
b/tests/phpunit/includes/SanitizerTest.php
index 7256694..6fc25df 100644
--- a/tests/phpunit/includes/SanitizerTest.php
+++ b/tests/phpunit/includes/SanitizerTest.php
@@ -388,7 +388,7 @@
*/
public function testEscapeIdReferenceList( $referenceList, $id1, $id2 )
{
$this->assertEquals(
- Sanitizer::escapeIdReferenceList( $referenceList,
'noninitial' ),
+ Sanitizer::escapeIdReferenceList( $referenceList ),
Sanitizer::escapeIdForAttribute( $id1 )
. ' '
. Sanitizer::escapeIdForAttribute( $id2 )
--
To view, visit https://gerrit.wikimedia.org/r/381514
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I22743102e75614bba848e09f032586923cef0f60
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits