• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-plugins: Commit

Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの


Commit MetaInfo

Revision8f2c9423a983de4cf24157a341d58cff9233fbc1 (tree)
Time2006-10-04 09:10:00
Authorshizuki <shizuki@1ca2...>
Commitershizuki

Log Message

bug fix

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@413 1ca29b6e-896d-4ea0-84a5-967f57386b96

Change Summary

Incremental Difference

--- a/trunk/NP_TagEX/NP_TagEX.php
+++ b/trunk/NP_TagEX/NP_TagEX.php
@@ -140,25 +140,29 @@ class NP_TagEX extends NucleusPlugin
140140 // Escape SQL query strings
141141 if (is_array($value)) {
142142 if (get_magic_quotes_gpc()) {
143- $value = array_map("stripslashes",$value);
143+ $value = array_map("stripslashes", $value);
144144 }
145145 if (!array_map("is_numeric",$value)) {
146- if (version_compare(phpversion(),"4.3.0") == "-1") {
146+ if (version_compare(phpversion(),"4.0.3") == "-1") {
147147 $value = array_map("mysql_escape_string",$value);
148148 } else {
149149 $value = array_map("mysql_real_escape_string",$value);
150150 }
151+ } else {
152+ $value = intval($value);
151153 }
152154 } else {
153155 if (get_magic_quotes_gpc()) {
154156 $value = stripslashes($value);
155157 }
156158 if (!is_numeric($value)) {
157- if (version_compare(phpversion(),"4.3.0") == "-1") {
159+ if (version_compare(phpversion(),"4.0.3") == "-1") {
158160 $value = "'" . mysql_escape_string($value) . "'";
159161 } else {
160162 $value = "'" . mysql_real_escape_string($value) . "'";
161163 }
164+ } else {
165+ $value = intval($value);
162166 }
163167 }
164168 return $value;
@@ -510,6 +514,7 @@ function resetOlder(old){
510514 }
511515
512516 if ($archive) {
517+ $y = $m = $d = '';
513518 sscanf($archive, '%d-%d-%d', $y, $m, $d);
514519 if ($d) {
515520 $timestamp_start = mktime(0, 0, 0, $m, $d, $y);
@@ -1087,23 +1092,23 @@ tagIndexSeparator
10871092 // <mod by shizuki>
10881093 if (isset($ready)) {
10891094 $ready = preg_replace('|[^a-z0-9-~+_.?#=&;,/:@%]|i', '', $ready);
1090- $reqReadyPlus = explode('+', $ready);
1091- foreach ($reqReadyPlus as $ANDkey => $ANDval) {
1095+ $reqReadyAND = explode('+', $ready);
1096+ foreach ($reqReadyAND as $ANDkey => $ANDval) {
10921097 if (strpos(':', $ANDval)) {
1093- $reqReadyOr = explode(':', $ANDval);
1094- foreach ($reqReadyOr as $ORkey => $ORval) {
1098+ $reqReadyOR = explode(':', $ANDval);
1099+ foreach ($reqReadyOR as $ORkey => $ORval) {
10951100 if (!$this->_isValidTag($ORval)) {
1096- $trush = array_splice($reqReadyOr);
1101+ $trush = array_splice($reqReadyOR);
10971102 }
10981103 }
1099- $ANDval = implode(':', $reqReadyOr);
1104+ $ANDval = implode(':', $reqReadyOR);
11001105 } else {
11011106 if (!$this->_isValidTag($ANDval)) {
11021107 $trush = array_splice($reqReadyAND);
11031108 }
11041109 }
11051110 }
1106- $ready = implode('+', $reqReadyPlus);
1111+ $ready = implode('+', $reqReadyAND);
11071112 }
11081113 // </mod by shizuki>
11091114
@@ -1134,15 +1139,11 @@ tagIndexSeparator
11341139 */
11351140 function _isValidTag($encodedTag)
11361141 {
1137- $encodedTag = rawurldecode($str);
1142+ $encodedTag = rawurldecode($encodedTag);
11381143 if (_CHERSET != 'UTF-8') {
11391144 $str = mb_convert_encoding($encodedTag, _CHARSET, "UTF-8");
11401145 }
1141- if (version_compare(phpversion(),"4.3.0")=="-1") {
1142- $str = '"' . mysql_escape_string($str) . '"';
1143- } else {
1144- $str = '"' . mysql_real_escape_string($str) . '"';
1145- }
1146+ $str = quote_smart($str);
11461147 $q = 'SELECT listid as result FROM %s WHERE tag = %s';
11471148 $Vali = quickQuery(sprintf($q, sql_table('plug_tagex_klist'), $str));
11481149 if (mysql_nums_row($Vali)) {
Show on old repository browser