Revisión | 004ef760328260a2ec8ced68cc05905cfd1d7b1d (tree) |
---|---|
Tiempo | 2022-01-24 02:08:24 |
Autor | ![]() |
Commiter | hai-fun |
PHP8
@@ -5,8 +5,10 @@ | ||
5 | 5 | // $Id: vote2.inc.php,v 0.12 2003/10/05 17:55:04 sha Exp $ |
6 | 6 | // based on vote.inc.php v1.14 |
7 | 7 | // |
8 | -// v0.2はインラインのリンクにtitleを付けた。 | |
8 | +// v0.2???ゃ?潟???ゃ?潟?????潟????itle??篁??????? | |
9 | 9 | |
10 | + // v0.13 PHP8絲上? 2021-12-17 by?????泣?? | |
11 | + | |
10 | 12 | function plugin_vote2_init() |
11 | 13 | { |
12 | 14 | $messages = array( |
@@ -16,11 +18,11 @@ function plugin_vote2_init() | ||
16 | 18 | 'arg_nolabel' => 'nolabel', |
17 | 19 | 'arg_notitle' => 'notitle', |
18 | 20 | 'title_error' => 'Error in vote2', |
19 | - 'no_page_error' => '$1 のページは存在しません', | |
20 | - 'update_failed' => '投票失敗:$1において投票先が無いか項目が合致しませんでした。', | |
21 | - 'body_error' => 'あるべき引数が渡されていないか、引数にエラーがあります。', | |
22 | - 'msg_collided' => '<h3>あなたが投票している間に、他の人が同じページの内容を更新してしまったようです。<br />従って、投票する位置を間違える可能性があります。<br /><br /> | |
23 | -あなたの更新を無効にしました。前のページをリロードしてやり直してください。</h3>' | |
21 | + 'no_page_error' => '$1 ?????若?吾????????障????', | |
22 | + 'update_failed' => '??腑?け??鐚?$1??????????腑??????<?????????????眼???障?????с??????', | |
23 | + 'body_error' => '?????鴻??綣??違??羝<????????????????綣??違???????若???????障????', | |
24 | + 'msg_collided' => '<h3>??????????腑???????????????篁???査?????????若?吾????絎鴻???贋?違???????障?c???????с????<br />緇??c??????腑?????篏?臀??????????????醇?с???????障????<br /><br /> | |
25 | +?????????贋?違???≦?鴻?????障?????????????若?吾???????若???????????眼?????????????</h3>' | |
24 | 26 | |
25 | 27 | ), |
26 | 28 | ); |
@@ -71,17 +73,18 @@ function plugin_vote2_action() | ||
71 | 73 | } |
72 | 74 | function plugin_vote2_inline() |
73 | 75 | { |
74 | - global $script,$vars,$digest, $_vote2_messages, $_vote_plugin_votes; | |
76 | + global $vars, $digest, $_vote2_messages, $_vote_plugin_votes; | |
75 | 77 | global $_vote_plugin_choice, $_vote_plugin_votes; |
76 | 78 | static $numbers = array(); |
77 | 79 | static $notitle = FALSE; |
80 | + $script = get_script_uri(); | |
78 | 81 | $str_notimestamp = $_vote2_messages['arg_notimestamp']; |
79 | 82 | $str_nonumber = $_vote2_messages['arg_nonumber']; |
80 | 83 | $str_nolabel = $_vote2_messages['arg_nolabel']; |
81 | 84 | $str_notitle = $_vote2_messages['arg_notitle']; |
82 | 85 | |
83 | 86 | $args = func_get_args(); |
84 | - array_pop($args); // {}内の要素の削除 | |
87 | + array_pop($args); // {}?????膣?????? | |
85 | 88 | $page = $vars['page']; |
86 | 89 | if (!array_key_exists($page,$numbers)) $numbers[$page] = 0; |
87 | 90 | $vote_inno = $numbers[$page]++; |
@@ -180,15 +183,16 @@ function plugin_vote2_address($match, $vote_no, $page, $ndigest) | ||
180 | 183 | break; |
181 | 184 | default: $vote_no = 'error'; break; |
182 | 185 | } |
183 | - $f_vote_no = htmlspecialchars($npage . '=' . $vote_no); | |
186 | + $f_vote_no = htmlsc($npage . '=' . $vote_no); | |
184 | 187 | return array($npage, $vote_no, $f_vote_no, $ndigest); |
185 | 188 | } |
186 | 189 | function plugin_vote2_convert() |
187 | 190 | { |
188 | - global $script,$vars,$digest, $_vote2_messages; | |
191 | + global $vars, $digest, $_vote2_messages; | |
189 | 192 | global $_vote_plugin_choice, $_vote_plugin_votes, $digests; |
190 | 193 | static $numbers = array(); |
191 | 194 | static $notitle = FALSE; |
195 | + $script = get_script_uri(); | |
192 | 196 | $str_notimestamp = $_vote2_messages['arg_notimestamp']; |
193 | 197 | $str_nonumber = $_vote2_messages['arg_nonumber']; |
194 | 198 | $str_nolabel = $_vote2_messages['arg_nolabel']; |
@@ -284,8 +288,8 @@ EOD; | ||
284 | 288 | } |
285 | 289 | } |
286 | 290 | |
287 | - $s_page = htmlspecialchars($page); | |
288 | - $s_digest = htmlspecialchars($ndigest); | |
291 | + $s_page = htmlsc($page); | |
292 | + $s_digest = htmlsc($ndigest); | |
289 | 293 | $title = $notitle ? '' : "title=\"$f_vote_no\""; |
290 | 294 | $body = <<<EOD |
291 | 295 | <form action="$script" method="post"> |
@@ -313,9 +317,10 @@ EOD; | ||
313 | 317 | } |
314 | 318 | function plugin_vote2_action_inline($vote_no) |
315 | 319 | { |
316 | - global $get,$vars,$script,$cols,$rows, $_vote2_messages; | |
320 | + global $get, $vars, $cols, $rows, $_vote2_messages; | |
317 | 321 | global $_title_collided,$_msg_collided,$_title_updated; |
318 | 322 | global $_vote_plugin_choice, $_vote_plugin_votes; |
323 | + $script = get_script_uri(); | |
319 | 324 | $str_notimestamp = $_vote2_messages['arg_notimestamp']; |
320 | 325 | $str_nonumber = $_vote2_messages['arg_nonumber']; |
321 | 326 | $str_nolabel = $_vote2_messages['arg_nolabel']; |
@@ -414,9 +419,10 @@ function plugin_vote2_action_inline($vote_no) | ||
414 | 419 | } |
415 | 420 | function plugin_vote2_action_block($vote_no) |
416 | 421 | { |
417 | - global $post,$vars,$script,$cols,$rows, $_vote2_messages; | |
422 | + global $post, $vars, $cols, $rows, $_vote2_messages; | |
418 | 423 | global $_title_collided,$_msg_collided,$_title_updated; |
419 | 424 | global $_vote_plugin_choice, $_vote_plugin_votes; |
425 | + $script = get_script_uri(); | |
420 | 426 | $str_notimestamp = $_vote2_messages['arg_notimestamp']; |
421 | 427 | $str_nonumber = $_vote2_messages['arg_nonumber']; |
422 | 428 | $str_nolabel = $_vote2_messages['arg_nolabel']; |