• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión7e3ba7d55bf0faf44eae960b141ca1ea76cb9b91 (tree)
Tiempo2022-01-24 02:06:51
Autorhai-fun <haifun129@gmai...>
Commiterhai-fun

Log Message

PHP8

Cambiar Resumen

Diferencia incremental

--- a/votex.inc.php
+++ b/votex.inc.php
@@ -16,9 +16,12 @@
1616 * @license http://www.gnu.org/licenses/gpl.html GPL2
1717 * @link http://lsx.sourceforge.jp/?Plugin%2Fvotex
1818 */
19+
20+ // v1.51 PHP8.0対応 2021-12-15 byはいふん
21+
1922 class PluginVotex
2023 {
21- function PluginVotex()
24+ function __construct()
2225 {
2326 // static
2427 static $CONF = array();
@@ -47,6 +50,10 @@ class PluginVotex
4750 textdomain('vote'); // use i18n msgs of vote.inc.php
4851 }
4952 }
53+
54+ function PluginVotex() {
55+ $this->__construct();
56+ }
5057
5158 // static
5259 var $CONF;
@@ -388,9 +395,9 @@ class PluginVotex
388395 function show_preview_form($msg = '', $body = '')
389396 {
390397 global $vars, $rows, $cols;
391- $s_refer = htmlspecialchars($vars['refer']);
392- $s_digest = htmlspecialchars($vars['digest']);
393- $s_body = htmlspecialchars($body);
398+ $s_refer = htmlsc($vars['refer']);
399+ $s_digest = htmlsc($vars['digest']);
400+ $s_body = htmlsc($body);
394401 $form = '';
395402 $form .= $msg . "\n";
396403 $form .= '<form action="' . get_script_uri() . '?cmd=preview" method="post">' . "\n";
@@ -467,8 +474,8 @@ class PluginVotex
467474 $r_choice_id = rawurlencode($choice_id);
468475 $r_choice = rawurlencode($choice);
469476 $r_count = rawurlencode($count);
470- $s_choice = htmlspecialchars($choice);
471- $s_count = htmlspecialchars($count);
477+ $s_choice = htmlsc($choice);
478+ $s_count = htmlsc($count);
472479 if ($this->options['readonly']) {
473480 $form .= $s_choice . '<span>&nbsp;' . $s_count . '&nbsp;</span>';
474481 } else {
@@ -517,7 +524,7 @@ class PluginVotex
517524 function &restore_args_inline(&$votes, &$options, &$default_options)
518525 {
519526 // currently same
520- return $this->restore_args_convert($votes, $options, &$default_options);
527+ return $this->restore_args_convert($votes, $options, $default_options);
521528 }
522529
523530 /**
@@ -578,7 +585,10 @@ class PluginVotex
578585 foreach ($args as $arg) {
579586 $arg = trim($arg);
580587 list($key, $val) = array_pad(explode('=', $arg, 2), 2, TRUE);
581- if (array_key_exists($key, $options)) {
588+ if (empty($options)) {
589+
590+ }
591+ else if (array_key_exists($key, $options)) {
582592 $options[$key] = $val;
583593 continue;
584594 }
@@ -648,8 +658,8 @@ class PluginVotex
648658 global $vars, $defaultpage;
649659 global $digest;
650660 $page = isset($vars['page']) ? $vars['page'] : $defaultpage;
651- $s_page = htmlspecialchars($page);
652- $s_digest = htmlspecialchars($digest);
661+ $s_page = htmlsc($page);
662+ $s_digest = htmlsc($digest);
653663 $script = ($this->options['readonly']) ? '' : get_script_uri();
654664 $submit = ($this->options['readonly']) ? 'hidden' : 'submit';
655665 $choicestyle = 'padding-left:1em;padding-right:1em;';
@@ -697,7 +707,7 @@ class PluginVotex
697707 list($choice, $count) = $vote;
698708 $class = ($choice_id % 2) ? 'vote_td1' : 'vote_td2';
699709 $s_choice = make_link($choice);
700- $s_count = htmlspecialchars($count);
710+ $s_count = htmlsc($count);
701711 $choice_key = $this->encode_choice($choice_id);
702712 if ($this->options['barchart']) {
703713 $percent = (int)(($count / $max) * 100); // / $sum