Index: trunk/extensions/TSPoll/http.func.php |
— | — | @@ -162,5 +162,3 @@ |
163 | 163 | } |
164 | 164 | } |
165 | 165 | } |
166 | | - |
167 | | -?> |
\ No newline at end of file |
Index: trunk/extensions/TSPoll/TSPoll.i18n.php |
— | — | @@ -1,12 +1,21 @@ |
2 | 2 | <?php |
3 | 3 | /** |
| 4 | + * Internationalisation file for TSPoll extension. |
| 5 | + * |
| 6 | + * @file |
4 | 7 | * @ingroup Extensions |
5 | 8 | */ |
6 | 9 | |
7 | 10 | $messages = array(); |
| 11 | + |
8 | 12 | $messages['en'] = array( |
9 | | - 'descript_msg' => 'Include the [http://www.toolserver.org/~jan/poll/index.php Toolserver-Poll-Skript] as a HTML-tag', |
| 13 | + 'tspoll-desc' => 'Include the [http://www.toolserver.org/~jan/poll/index.php Toolserver-Poll-Skript] as a HTML-tag', |
| 14 | + 'tspoll-fetch-error' => 'Error while fetching the URL!', |
10 | 15 | ); |
| 16 | + |
| 17 | +/** German (Deutsch) |
| 18 | + * @author Jan Luca |
| 19 | + */ |
11 | 20 | $messages['de'] = array( |
12 | | - 'descript_msg' => 'Bindet das [http://www.toolserver.org/~jan/poll/index.php Toolserver-Poll-Skript] als ein HTML-Tag ein', |
| 21 | + 'tspoll-desc' => 'Bindet das [http://www.toolserver.org/~jan/poll/index.php Toolserver-Poll-Skript] als ein HTML-Tag ein', |
13 | 22 | ); |
Index: trunk/extensions/TSPoll/TSPoll.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | 'version' => '1.0 Dev', |
31 | 31 | 'author' => 'Jan Luca', |
32 | 32 | 'url' => 'http://www.mediawiki.org/wiki/User:Jan_Luca/Extension:TSPoll', |
33 | | - 'descriptionmsg'=> 'descript_msg' |
| 33 | + 'descriptionmsg'=> 'tspoll-desc' |
34 | 34 | ); |
35 | 35 | |
36 | 36 | //Avoid unstubbing $wgParser on setHook() too early on modern (1.12+) MW versions, as per r35980 |
— | — | @@ -45,27 +45,26 @@ |
46 | 46 | function efTSPollSetup() { |
47 | 47 | global $wgParser; |
48 | 48 | $wgParser->setHook( 'TSPoll', 'efTSPollRender' ); |
49 | | - $wgParser->setHook( 'tspoll', 'efTSPollRender' ); |
50 | | - return true; |
| 49 | + $wgParser->setHook( 'tspoll', 'efTSPollRender' ); |
| 50 | + return true; |
51 | 51 | } |
52 | 52 | |
53 | 53 | function efTSPollRender( $input, $args, $parser ) { |
54 | | - foreach( $args as $name => $value ) { |
55 | | - if ($name == "id") { |
56 | | - $id = htmlspecialchars( $value ); |
57 | | - break; |
58 | | - } |
59 | | - else { |
60 | | - continue; |
61 | | - } |
62 | | - } |
| 54 | + |
| 55 | + if ( isset( $args['id'] ) ) { |
| 56 | + $id = wfUrlencode( $args['id'] ); |
| 57 | + } else { |
| 58 | + // @todo: maybe output an error? |
| 59 | + $id = ''; |
| 60 | + } |
63 | 61 | |
64 | | - $http = new http_w("toolserver.org","/~jan/poll/main.php?page=wiki_output&id=".$id.""); |
65 | | - $get_server = $http->get(""); |
66 | | - if($get_server != "") { |
67 | | - return $get_server; |
68 | | - } |
69 | | - else { |
70 | | - return "Fehler beim Holen!"; |
71 | | - } |
| 62 | + $http = new http_w( 'toolserver.org', '/~jan/poll/main.php?page=wiki_output&id=' . $id ); |
| 63 | + $get_server = $http->get( '' ); |
| 64 | + if( false&& $get_server != '' ) { |
| 65 | + return $get_server; |
| 66 | + } |
| 67 | + else { |
| 68 | + wfLoadExtensionMessages( 'TSPoll' ); |
| 69 | + return wfMsgExt( 'tspoll-fetch-error', array( 'parse' ) ); |
| 70 | + } |
72 | 71 | } |
Property changes on: trunk/extensions/TSPoll/README |
___________________________________________________________________ |
Name: svn:eol-style |
73 | 72 | + native |