Index: trunk/phase3/tests/phpunit/includes/parser/TagHooks.php |
— | — | @@ -6,11 +6,11 @@ |
7 | 7 | class TagHookTest extends MediaWikiTestCase { |
8 | 8 | |
9 | 9 | public static function provideValidNames() { |
10 | | - return array( array( 'foo' ), array( 'foo-bar' ), array( 'foo_bar' ), array( 'FOO-BAR' ) ); |
| 10 | + return array( array( 'foo' ), array( 'foo-bar' ), array( 'foo_bar' ), array( 'FOO-BAR' ), array( 'foo bar' ) ); |
11 | 11 | } |
12 | 12 | |
13 | 13 | public static function provideBadNames() { |
14 | | - return array( array( "foo<bar" ), array( "foo>bar" ), array( "foo bar" ), array( "foo\nbar" ), array( "foo\rbar" ) ); |
| 14 | + return array( array( "foo<bar" ), array( "foo>bar" ), array( "foo\nbar" ), array( "foo\rbar" ) ); |
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -4315,7 +4315,7 @@ |
4316 | 4316 | */ |
4317 | 4317 | public function setHook( $tag, $callback ) { |
4318 | 4318 | $tag = strtolower( $tag ); |
4319 | | - if ( preg_match( '/[<> \r\n]/', $tag, $m ) ) throw new MWException( "Invalid character {$m[0]} in setHook('$tag', ...) call" ); |
| 4319 | + if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) throw new MWException( "Invalid character {$m[0]} in setHook('$tag', ...) call" ); |
4320 | 4320 | $oldVal = isset( $this->mTagHooks[$tag] ) ? $this->mTagHooks[$tag] : null; |
4321 | 4321 | $this->mTagHooks[$tag] = $callback; |
4322 | 4322 | if ( !in_array( $tag, $this->mStripList ) ) { |
— | — | @@ -4327,7 +4327,7 @@ |
4328 | 4328 | |
4329 | 4329 | function setTransparentTagHook( $tag, $callback ) { |
4330 | 4330 | $tag = strtolower( $tag ); |
4331 | | - if ( preg_match( '/[<> \r\n]/', $tag, $m ) ) throw new MWException( "Invalid character {$m[0]} in setHook('$tag', ...) call" ); |
| 4331 | + if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) throw new MWException( "Invalid character {$m[0]} in setHook('$tag', ...) call" ); |
4332 | 4332 | $oldVal = isset( $this->mTransparentTagHooks[$tag] ) ? $this->mTransparentTagHooks[$tag] : null; |
4333 | 4333 | $this->mTransparentTagHooks[$tag] = $callback; |
4334 | 4334 | |
— | — | @@ -4432,7 +4432,7 @@ |
4433 | 4433 | */ |
4434 | 4434 | function setFunctionTagHook( $tag, $callback, $flags ) { |
4435 | 4435 | $tag = strtolower( $tag ); |
4436 | | - if ( preg_match( '/[<> \r\n]/', $tag, $m ) ) throw new MWException( "Invalid character {$m[0]} in setHook('$tag', ...) call" ); |
| 4436 | + if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) throw new MWException( "Invalid character {$m[0]} in setHook('$tag', ...) call" ); |
4437 | 4437 | $old = isset( $this->mFunctionTagHooks[$tag] ) ? |
4438 | 4438 | $this->mFunctionTagHooks[$tag] : null; |
4439 | 4439 | $this->mFunctionTagHooks[$tag] = array( $callback, $flags ); |