}
/**
- * urlencodes a string according to one of three patterns: (bug 22474)
+ * urlencodes a string according to one of three patterns: (T24474)
*
* By default (for HTTP "query" strings), spaces are encoded as '+'.
* Or to encode a value for the HTTP "path", spaces are encoded as '%20'.
$magicWords = new MagicWordArray( [ 'url_path', 'url_query', 'url_wiki' ] );
}
switch ( $magicWords->matchStartToEnd( $arg ) ) {
-
// Encode as though it's a wiki page, '_' for ' '.
case 'url_wiki':
$func = 'wfUrlencode';
}
if ( !is_null( $title ) ) {
# Convert NS_MEDIA -> NS_FILE
- if ( $title->getNamespace() == NS_MEDIA ) {
+ if ( $title->inNamespace( NS_MEDIA ) ) {
$title = Title::makeTitle( NS_FILE, $title->getDBkey() );
}
if ( !is_null( $arg ) ) {
// allow prefix.
$title = Title::newFromText( $username );
- if ( $title && $title->getNamespace() == NS_USER ) {
+ if ( $title && $title->inNamespace( NS_USER ) ) {
$username = $title->getText();
}