r40304 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40303‎ | r40304 | r40305 >
Date:15:02, 1 September 2008
Author:skizzerz
Status:old
Tags:
Comment:
* bugfixes, partial revert of message id renames
Modified paths:
  • /trunk/extensions/ExternalImageWhitelist/ExternalImageWhitelist.i18n.php (modified) (history)
  • /trunk/extensions/ExternalImageWhitelist/ExternalImageWhitelist.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ExternalImageWhitelist/ExternalImageWhitelist.i18n.php
@@ -1,6 +1,7 @@
22 <?php
 3+
34 /**
4 - * Internationalisation file for extension ExternalImageWhitelist.
 5+ * Internationalisation file for extension External image whitelist
56 *
67 * @addtogroup Extensions
78 */
@@ -8,15 +9,15 @@
910 $messages = array();
1011
1112 /** English
12 - * @author Ryan Schmidt
 13+ * @author Skizzerz
1314 */
1415 $messages['en'] = array(
15 - 'externalimagewhitelist' => " #<pre>Leave this line exactly as it is
 16+ 'external_image_whitelist' => " #<pre>Leave this line exactly as it is
1617 #Put regular expression fragments (just the part that goes between the //) below
1718 #These will be matched with the URLs of external (hotlinked) images
1819 #Those that match will be displayed as images, otherwise only a link to the image will be shown
1920 #Lines beginning with # are treated as comments
2021
21 -#Put all regex fragments ABOVE this line. Leave this line exactly as it is</pre>",
 22+#Put all regex fragments above this line. Leave this line exactly as it is</pre>",
2223 'externalimagewhitelist-desc' => 'Only allow external (hotlinked) images to be displayed when they match a regex on an on-wiki whitelist',
23 -);
 24+);
\ No newline at end of file
Index: trunk/extensions/ExternalImageWhitelist/ExternalImageWhitelist.php
@@ -15,12 +15,12 @@
1616 'name' => 'External image whitelist',
1717 'author' => 'Ryan Schmidt',
1818 'url' => 'http://www.mediawiki.org/wiki/Extension:External_image_whitelist',
19 - 'version' => '0.2'
 19+ 'version' => '1.0',
2020 'description' => 'Only allow external (hotlinked) images to be displayed when they match a regex on an on-wiki whitelist',
2121 'descriptionmsg' => 'externalimagewhitelist-desc',
2222 );
2323
24 -$wgExtensionMessagesFiles['Extimgwl'] = 'ExternalImageWhitelist.i18n.php';
 24+$wgExtensionMessagesFiles['Extimgwl'] = dirname(__FILE__) . '/ExternalImageWhitelist.i18n.php';
2525
2626 $wgHooks['LinkerMakeExternalLink'][] = 'efExtImgWl';
2727
@@ -29,13 +29,13 @@
3030
3131 function efExtImgWl(&$url, &$text, &$html) {
3232 global $wgAllowExternalImages, $wgExtImgWlExtensions;
33 -
 33+
3434 if($wgAllowExternalImages)
3535 return true;
3636 $ext = implode('|', preg_replace('[^a-zA-Z0-9]', '', $wgExtImgWlExtensions));
3737 if(!preg_match('/\.'.$ext.'$/i', $url))
3838 return true;
39 - $whitelist = explode("\n", wfMsg('externalimagewhitelist'));
 39+ $whitelist = explode("\n", wfMsgForContent('external_image_whitelist'));
4040 foreach($whitelist as $entry) {
4141 $entry = trim($entry);
4242 if($entry == '')
@@ -48,4 +48,4 @@
4949 }
5050 }
5151 return true;
52 -}
 52+}
\ No newline at end of file