$tables[] = 'change_tag';
$join_conds['change_tag'] = [ 'INNER JOIN', $join_cond ];
- $conds['ct_tag'] = explode( ',', $filter_tag );
+ $conds['ct_tag'] = explode( '|', $filter_tag );
}
}
return Status::newFatal( 'tags-create-no-name' );
}
- // tags cannot contain commas (used as a delimiter in tag_summary table) or
- // slashes (would break tag description messages in MediaWiki namespace)
- if ( strpos( $tag, ',' ) !== false || strpos( $tag, '/' ) !== false ) {
+ // tags cannot contain commas (used as a delimiter in tag_summary table),
+ // pipe (used as a delimiter between multiple tags in
+ // modifyDisplayQuery), or slashes (would break tag description messages in
+ // MediaWiki namespace)
+ if ( strpos( $tag, ',' ) !== false || strpos( $tag, '|' ) !== false
+ || strpos( $tag, '/' ) !== false ) {
return Status::newFatal( 'tags-create-invalid-chars' );
}
// Namespace filtering
if ( $opts[ 'namespace' ] !== '' ) {
- $namespaces = explode( ',', $opts[ 'namespace' ] );
+ $namespaces = explode( ';', $opts[ 'namespace' ] );
if ( $opts[ 'associated' ] ) {
$associatedNamespaces = array_map(
if ( preg_match( '/^days=(\d+)$/', $bit, $m ) ) {
$opts['days'] = $m[1];
}
- if ( preg_match( '/^namespace=(\d+)$/', $bit, $m ) ) {
+ if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) ) {
$opts['namespace'] = $m[1];
}
if ( preg_match( '/^tagfilter=(.*)$/', $bit, $m ) ) {
"rc_namespace IN ('1','2','3')",
],
[
- 'namespace' => '1,2,3',
+ 'namespace' => '1;2;3',
],
"rc conditions with multiple namespaces"
);
"rc_namespace IN ('0','1','4','5','6','7')",
],
[
- 'namespace' => '1,4,7',
+ 'namespace' => '1;4;7',
'associated' => 1,
],
"rc conditions with multiple namespaces and associated"
"rc_namespace NOT IN ('2','3','8','9')",
],
[
- 'namespace' => '2,3,9',
+ 'namespace' => '2;3;9',
'associated' => 1,
'invert' => 1
],
"rc_namespace NOT IN ('1','2','3')",
],
[
- 'namespace' => '1,2,3',
+ 'namespace' => '1;2;3',
'invert' => 1,
],
"rc conditions with multiple namespaces inverted"
[ 'days=3', [ 'days' => '3' ] ],
- [ 'namespace=5', [ 'namespace' => 5 ] ],
+ [ 'namespace=5', [ 'namespace' => '5' ] ],
+
+ [ 'namespace=5|3', [ 'namespace' => '5|3' ] ],
[ 'tagfilter=foo', [ 'tagfilter' => 'foo' ] ],
+
+ [ 'tagfilter=foo;bar', [ 'tagfilter' => 'foo;bar' ] ],
];
}