* Introduce wfMsgWithLinks() and a content-language counterpart, wfMsgForContentWithLinks(); these escape HTML and render wiki links in text, so should be suitable for labels and so on
* Make Linker::formatLinksInComment() public
files
* (bug 7997) Allow users to be blocked from using Special:Emailuser
* (bug 8989) Blacklist 'mhtml' and 'mht' files from upload
+* (bug 8760) Allow wiki links in "protectexpiry" message
== Bugfixes since 1.10 ==
return wfMsgReal( $key, $args, true );
}
+/**
+ * Get a message in the user interface language and replace wiki
+ * links with clickable ones, escaping other HTML
+ *
+ * @param string $key Message key
+ * @return string
+ */
+function wfMsgWithLinks( $key ) {
+ global $wgUser;
+ $args = func_get_args();
+ return $wgUser->getSkin()->formatLinksInComment( htmlspecialchars(
+ call_user_func_array( 'wfMsg', $args ) ) );
+}
+
/**
* Same as above except doesn't transform the message
*/
return wfMsgReal( $key, $args, true, $forcontent );
}
+/**
+ * Get a message in the content language and replace wiki
+ * links with clickable ones, escaping other HTML
+ *
+ * @param string $key Message key
+ * @return string
+ */
+function wfMsgForContentWithLinks( $key ) {
+ global $wgUser;
+ return $wgUser->getSkin()->formatLinksInComment( htmlspecialchars(
+ call_user_func_array( 'wfMsgForContent', func_get_args() ) ) );
+}
+
/**
* Same as above except doesn't transform the message
*/
}
/**
- * Format regular and media links - all other wiki formatting is ignored
- * Called by Linker::formatComment.
- * @param $comment The comment text.
- * @return Comment text with links using HTML.
+ * Formats wiki links and media links in text; all other wiki formatting
+ * is ignored
+ *
+ * @param string $comment Text to format links in
+ * @return string
*/
- private function formatLinksInComment( $comment ) {
+ public function formatLinksInComment( $comment ) {
global $wgContLang;
$medians = '(?:' . preg_quote( Namespace::getCanonicalName( NS_MEDIA ), '/' ) . '|';
}
function buildExpiryInput() {
- $id = 'mwProtect-expiry';
-
- $ci = "<tr><td align=\"right\">";
- $ci .= wfElement( 'label', array (
- 'id' => "$id-label",
- 'for' => $id ),
- wfMsg( 'protectexpiry' ) );
- $ci .= "</td> <td align=\"left\">";
- $ci .= wfElement( 'input', array(
- 'size' => 60,
- 'name' => $id,
- 'id' => $id,
- 'value' => $this->mExpiry ) + $this->disabledAttrib );
- $ci .= "</td></tr>";
-
- return $ci;
+ $attribs = array( 'id' => 'expires' ) + $this->disabledAttrib;
+ return '<tr>'
+ . '<td><label for="expires">' . wfMsgWithLinks( 'protectexpiry' ) . '</label></td>'
+ . '<td>' . Xml::input( 'mwProtect-expiry', 60, $this->mExpiry, $attribs ) . '</td>'
+ . '</tr>';
}
function buildWatchInput() {