Index: trunk/phase3/includes/ProtectionForm.php |
— | — | @@ -318,22 +318,11 @@ |
319 | 319 | } |
320 | 320 | |
321 | 321 | function buildExpiryInput() { |
322 | | - $id = 'mwProtect-expiry'; |
323 | | - |
324 | | - $ci = "<tr><td align=\"right\">"; |
325 | | - $ci .= wfElement( 'label', array ( |
326 | | - 'id' => "$id-label", |
327 | | - 'for' => $id ), |
328 | | - wfMsg( 'protectexpiry' ) ); |
329 | | - $ci .= "</td> <td align=\"left\">"; |
330 | | - $ci .= wfElement( 'input', array( |
331 | | - 'size' => 60, |
332 | | - 'name' => $id, |
333 | | - 'id' => $id, |
334 | | - 'value' => $this->mExpiry ) + $this->disabledAttrib ); |
335 | | - $ci .= "</td></tr>"; |
336 | | - |
337 | | - return $ci; |
| 322 | + $attribs = array( 'id' => 'expires' ) + $this->disabledAttrib; |
| 323 | + return '<tr>' |
| 324 | + . '<td><label for="expires">' . wfMsgWithLinks( 'protectexpiry' ) . '</label></td>' |
| 325 | + . '<td>' . Xml::input( 'mwProtect-expiry', 60, $this->mExpiry, $attribs ) . '</td>' |
| 326 | + . '</tr>'; |
338 | 327 | } |
339 | 328 | |
340 | 329 | function buildWatchInput() { |
Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -327,6 +327,20 @@ |
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
| 331 | + * Get a message in the user interface language and replace wiki |
| 332 | + * links with clickable ones, escaping other HTML |
| 333 | + * |
| 334 | + * @param string $key Message key |
| 335 | + * @return string |
| 336 | + */ |
| 337 | +function wfMsgWithLinks( $key ) { |
| 338 | + global $wgUser; |
| 339 | + $args = func_get_args(); |
| 340 | + return $wgUser->getSkin()->formatLinksInComment( htmlspecialchars( |
| 341 | + call_user_func_array( 'wfMsg', $args ) ) ); |
| 342 | +} |
| 343 | + |
| 344 | +/** |
331 | 345 | * Same as above except doesn't transform the message |
332 | 346 | */ |
333 | 347 | function wfMsgNoTrans( $key ) { |
— | — | @@ -369,6 +383,19 @@ |
370 | 384 | } |
371 | 385 | |
372 | 386 | /** |
| 387 | + * Get a message in the content language and replace wiki |
| 388 | + * links with clickable ones, escaping other HTML |
| 389 | + * |
| 390 | + * @param string $key Message key |
| 391 | + * @return string |
| 392 | + */ |
| 393 | +function wfMsgForContentWithLinks( $key ) { |
| 394 | + global $wgUser; |
| 395 | + return $wgUser->getSkin()->formatLinksInComment( htmlspecialchars( |
| 396 | + call_user_func_array( 'wfMsgForContent', func_get_args() ) ) ); |
| 397 | +} |
| 398 | + |
| 399 | +/** |
373 | 400 | * Same as above except doesn't transform the message |
374 | 401 | */ |
375 | 402 | function wfMsgForContentNoTrans( $key ) { |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -926,12 +926,13 @@ |
927 | 927 | } |
928 | 928 | |
929 | 929 | /** |
930 | | - * Format regular and media links - all other wiki formatting is ignored |
931 | | - * Called by Linker::formatComment. |
932 | | - * @param $comment The comment text. |
933 | | - * @return Comment text with links using HTML. |
| 930 | + * Formats wiki links and media links in text; all other wiki formatting |
| 931 | + * is ignored |
| 932 | + * |
| 933 | + * @param string $comment Text to format links in |
| 934 | + * @return string |
934 | 935 | */ |
935 | | - private function formatLinksInComment( $comment ) { |
| 936 | + public function formatLinksInComment( $comment ) { |
936 | 937 | global $wgContLang; |
937 | 938 | |
938 | 939 | $medians = '(?:' . preg_quote( Namespace::getCanonicalName( NS_MEDIA ), '/' ) . '|'; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -66,6 +66,7 @@ |
67 | 67 | files |
68 | 68 | * (bug 7997) Allow users to be blocked from using Special:Emailuser |
69 | 69 | * (bug 8989) Blacklist 'mhtml' and 'mht' files from upload |
| 70 | +* (bug 8760) Allow wiki links in "protectexpiry" message |
70 | 71 | |
71 | 72 | == Bugfixes since 1.10 == |
72 | 73 | |