Index: trunk/extensions/ExternalImageWhitelist/ExternalImageWhitelist.i18n.php |
— | — | @@ -1,6 +1,7 @@ |
2 | 2 | <?php |
| 3 | + |
3 | 4 | /** |
4 | | - * Internationalisation file for extension ExternalImageWhitelist. |
| 5 | + * Internationalisation file for extension External image whitelist |
5 | 6 | * |
6 | 7 | * @addtogroup Extensions |
7 | 8 | */ |
— | — | @@ -8,15 +9,15 @@ |
9 | 10 | $messages = array(); |
10 | 11 | |
11 | 12 | /** English |
12 | | - * @author Ryan Schmidt |
| 13 | + * @author Skizzerz |
13 | 14 | */ |
14 | 15 | $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 |
16 | 17 | #Put regular expression fragments (just the part that goes between the //) below |
17 | 18 | #These will be matched with the URLs of external (hotlinked) images |
18 | 19 | #Those that match will be displayed as images, otherwise only a link to the image will be shown |
19 | 20 | #Lines beginning with # are treated as comments |
20 | 21 | |
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>", |
22 | 23 | '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 @@ |
16 | 16 | 'name' => 'External image whitelist', |
17 | 17 | 'author' => 'Ryan Schmidt', |
18 | 18 | 'url' => 'http://www.mediawiki.org/wiki/Extension:External_image_whitelist', |
19 | | - 'version' => '0.2' |
| 19 | + 'version' => '1.0', |
20 | 20 | 'description' => 'Only allow external (hotlinked) images to be displayed when they match a regex on an on-wiki whitelist', |
21 | 21 | 'descriptionmsg' => 'externalimagewhitelist-desc', |
22 | 22 | ); |
23 | 23 | |
24 | | -$wgExtensionMessagesFiles['Extimgwl'] = 'ExternalImageWhitelist.i18n.php'; |
| 24 | +$wgExtensionMessagesFiles['Extimgwl'] = dirname(__FILE__) . '/ExternalImageWhitelist.i18n.php'; |
25 | 25 | |
26 | 26 | $wgHooks['LinkerMakeExternalLink'][] = 'efExtImgWl'; |
27 | 27 | |
— | — | @@ -29,13 +29,13 @@ |
30 | 30 | |
31 | 31 | function efExtImgWl(&$url, &$text, &$html) { |
32 | 32 | global $wgAllowExternalImages, $wgExtImgWlExtensions; |
33 | | - |
| 33 | + |
34 | 34 | if($wgAllowExternalImages) |
35 | 35 | return true; |
36 | 36 | $ext = implode('|', preg_replace('[^a-zA-Z0-9]', '', $wgExtImgWlExtensions)); |
37 | 37 | if(!preg_match('/\.'.$ext.'$/i', $url)) |
38 | 38 | return true; |
39 | | - $whitelist = explode("\n", wfMsg('externalimagewhitelist')); |
| 39 | + $whitelist = explode("\n", wfMsgForContent('external_image_whitelist')); |
40 | 40 | foreach($whitelist as $entry) { |
41 | 41 | $entry = trim($entry); |
42 | 42 | if($entry == '') |
— | — | @@ -48,4 +48,4 @@ |
49 | 49 | } |
50 | 50 | } |
51 | 51 | return true; |
52 | | -} |
| 52 | +} |
\ No newline at end of file |