Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -782,7 +782,7 @@ |
783 | 783 | fault values, with a value of false meaning to suppress the attribute. |
784 | 784 | &$query: the query string to add to the generated URL (the bit after the "?"), |
785 | 785 | in associative array form, with keys and values unescaped. |
786 | | -&$options: the options. Can include 'known', 'broken', 'noclasses'. |
| 786 | +&$options: array of options. Can include 'known', 'broken', 'noclasses'. |
787 | 787 | &$ret: the value to return if your hook returns false. |
788 | 788 | |
789 | 789 | 'LinkEnd': Used when generating internal and interwiki links in Linker::link(), |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -170,6 +170,11 @@ |
171 | 171 | */ |
172 | 172 | public function link( $target, $text = null, $customAttribs = array(), $query = array(), $options = array() ) { |
173 | 173 | wfProfileIn( __METHOD__ ); |
| 174 | + if( !$target instanceof Title ) { |
| 175 | + return "<!-- ERROR -->$text"; |
| 176 | + } |
| 177 | + $options = (array)$options; |
| 178 | + |
174 | 179 | $ret = null; |
175 | 180 | if( !wfRunHooks( 'LinkBegin', array( $this, $target, &$text, |
176 | 181 | &$customAttribs, &$query, &$options, &$ret ) ) ) { |
— | — | @@ -177,11 +182,6 @@ |
178 | 183 | return $ret; |
179 | 184 | } |
180 | 185 | |
181 | | - if( !$target instanceof Title ) { |
182 | | - return "<!-- ERROR -->$text"; |
183 | | - } |
184 | | - $options = (array)$options; |
185 | | - |
186 | 186 | # Normalize the Title if it's a special page |
187 | 187 | $target = $this->normaliseSpecialPage( $target ); |
188 | 188 | |