PHP 5.4 사용에 따른 버그 패치 Htmlspecialchars Http://Sitehis.Com/Db_talk_546
로빈아빠
본문
get_magic_quotes_gpc()가 무조건 false 리턴되고,
register_globals = on 옵션이 사라져서, extract를 직접 해줘야 한다.- @extract($_GET);
- @extract($_POST);
- @extract($_SERVER);
- echo htmlspecialchars('한글',ENT_QUOTES,'ISO-8859-1'); 로 사용
- sinc/lib/b3EnumSetFieldsToOptionTag_write.php
- 일괄변경 ENT_QUOTES) => ENT_QUOTES,'ISO-8859-1')
- find . -name "*.php" -exec grep -Hn "htmlspecialchars(\\\$" {} \;
- find . -name "*.php" -exec perl -pi -e 's/htmlspecialchars\(\$enum_atom\)/htmlspecialchars\(\$enum_atom,ENT_QUOTES,'\''ISO\-8859\-1'\''\)/g' {} \;
- find . -name "*.php" -exec perl -pi -e 's/htmlspecialchars\(\$enum_atom,ENT_QUOTES\)/htmlspecialchars\(\$enum_atom,ENT_QUOTES,'\''ISO\-8859\-1'\''\)/g' {} \;
- find . -name "*.php" -exec perl -pi -e 's/htmlspecialchars\(\$value,ENT_QUOTES\)/htmlspecialchars\(\$value,ENT_QUOTES,'\''ISO\-8859\-1'\''\)/g' {} \;
- find . -name "*.php" -exec perl -pi -e 's/htmlspecialchars\(\$list\[\$value\],ENT_QUOTES\)/htmlspecialchars\(\$list\[\$value\],ENT_QUOTES,'\''ISO\-8859\-1'\''\)/g' {} \;
UTF-8이면
lib/function_mysql3.php
- $stripslashes 값이 1에서 0으로 변경함
function db_str($str, $stripslashes=1, $db_conn='d')
=> function db_str($str, $stripslashes=0, $db_conn='d')
- else $sql_set .= ', `'.$value.'` ="'.$_POST[$value]. '"';
=> else $sql_set .= ', `'.$value.'` ="'.db_str($_POST[$value],0). '"';
find . -name "*.php" -exec perl -pi -e 's/else \$sql_set \.\= '\'', `'\''\.\$value\.'\''` \="'\''\.\$_POST\[\$value\]\. '\''"'\'';/else \$sql_set \.\= '\'', `'\''\.\$value\.'\''` \="'\''\.db_str\(\$_POST\[\$value\],0\)\. '\''"'\'';/g' {} \; - else $sql_set .= ', '.$value.' ="'.$_POST[$value]. '"';
=>else $sql_set .= ', `'.$value.'` ="'.db_str($_POST[$value],0). '"';
find . -name "*.php" -exec perl -pi -e 's/else \$sql_set \.\= '\'', '\''\.\$value\.'\'' \="'\''\.\$_POST\[\$value\]\. '\''"'\'';/else \$sql_set \.\= '\'', `'\''\.\$value\.'\''` \="'\''\.db_str\(\$_POST\[\$value\],0\)\. '\''"'\'';/g' {} \;
- if(isset($qs[$value])) $sql_set .= ", $value = '" . $qs[$value] . '\' ';
find . -name "*.php" -exec perl -pi -e 's/if\(isset\(\$qs\[\$value\]\)\) \$sql_set \.\= ", \$value \= '\''" \. \$qs\[\$value\] \. '\''\\'\'' '\'';/if\(isset\(\$qs\[\$value\]\)\) \$sql_set \.\= ", `\$value` \= '\''" \.db_str\(\$qs\[\$value\],0\)\. '\''\\'\'' '\'';/g' {} \;
- elseif(isset($_POST[$value])) $sql_set .= ", $value = '" . $_POST[$value] . '\' ';
find . -name "*.php" -exec perl -pi -e 's/elseif\(isset\(\$_POST\[\$value\]\)\) \$sql_set \.\= ", \$value \= '\''" \. \$_POST\[\$value\] \. '\''\\'\'' '\'';/elseif\(isset\(\$_POST\[\$value\]\)\) \$sql_set \.\= ", `\$value` \= '\''"\. db_str\(\$_POST\[\$value\],0\)\. '\''\\'\'' '\'';/g' {} \;
- 함수(&$list) ==> &삭제하고, 해당 함수에서 &붙임 function 함수 (&$list)
관련링크
댓글목록
등록된 댓글이 없습니다.