|| $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.
global $wgExperimentalHtmlIds;
$options = (array)$options;
- $id = self::decodeCharReferences( $id );
-
if ( $wgExperimentalHtmlIds && !in_array( 'legacy', $options ) ) {
$id = preg_replace( '/[ \t\n\r\f_\'"&#%]+/', '_', $id );
$id = trim( $id, '_' );
$mode = $wgFragmentMode[self::ID_PRIMARY];
$id = self::escapeIdInternal( $id, $mode );
- $id = self::urlEscapeId( $id, $mode );
return $id;
}
global $wgExternalInterwikiFragmentMode;
$id = self::escapeIdInternal( $id, $wgExternalInterwikiFragmentMode );
- $id = self::urlEscapeId( $id, $wgExternalInterwikiFragmentMode );
-
- return $id;
- }
-
- /**
- * Helper for escapeIdFor*() functions. URL-escapes the ID if needed.
- *
- * @param string $id String to escape
- * @param string $mode One of modes from $wgFragmentMode
- * @return string
- */
- private static function urlEscapeId( $id, $mode ) {
- if ( $mode === 'html5' ) {
- $id = urlencode( $id );
- $id = str_replace( '%3A', ':', $id );
- }
return $id;
}
* @return string
*/
private static function escapeIdInternal( $id, $mode ) {
- $id = self::decodeCharReferences( $id );
-
switch ( $mode ) {
case 'html5':
$id = str_replace( ' ', '_', $id );
* 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
*
* @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 );