codes****@googl*****
codes****@googl*****
2008年 9月 14日 (日) 07:59:42 JST
Author: mystralkk Date: Sat Sep 13 15:59:15 2008 New Revision: 535 Modified: trunk/plugins/dataproxy/admin/install.html trunk/plugins/dataproxy/admin/install_ja.html trunk/plugins/dataproxy/config.php trunk/plugins/dataproxy/dataproxy.php trunk/plugins/dataproxy/functions.inc Log: PHP-4.xでエラーになるのを避けるため、htmlentities(), html_entity_decode()を 使用しないように変更。 Modified: trunk/plugins/dataproxy/admin/install.html ============================================================================== --- trunk/plugins/dataproxy/admin/install.html (original) +++ trunk/plugins/dataproxy/admin/install.html Sat Sep 13 15:59:15 2008 @@ -70,6 +70,13 @@ <th>Description</th> </tr> <tr> + <td align="right">1.1.2</td> + <td>2008-09-14</td> + <td> + <span class="fix">Fixed</span> Upgraded to work well with PHP-4.x by not using htmlentities() and html_entity_decode() functions. + </td> + </tr> + <tr> <td align="right">1.1.1</td> <td>2008-09-11</td> <td> Modified: trunk/plugins/dataproxy/admin/install_ja.html ============================================================================== --- trunk/plugins/dataproxy/admin/install_ja.html (original) +++ trunk/plugins/dataproxy/admin/install_ja.html Sat Sep 13 15:59:15 2008 @@ -74,6 +74,13 @@ <th>内容</th> </tr> <tr> + <td align="right">1.1.2</td> + <td>2008-09-14</td> + <td> + <span class="fix">修正</span> PHP-4.xで起こるエラーを避けるため、 htmlentities(), html_entity_decode()関数を使用しないようにしました。 + </td> + </tr> + <tr> <td align="right">1.1.1</td> <td>2008-09-11</td> <td> Modified: trunk/plugins/dataproxy/config.php ============================================================================== --- trunk/plugins/dataproxy/config.php (original) +++ trunk/plugins/dataproxy/config.php Sat Sep 13 15:59:15 2008 @@ -45,6 +45,6 @@ // Plugin info -$_DPXY_CONF['pi_version'] = '1.1.0'; // Plugin Version +$_DPXY_CONF['pi_version'] = '1.1.2'; // Plugin Version $_DPXY_CONF['gl_version'] = '1.4.0'; // GL Version plugin for $_DPXY_CONF['pi_url'] = 'http://mystral-kk.net/'; // Plugin Homepage Modified: trunk/plugins/dataproxy/dataproxy.php ============================================================================== --- trunk/plugins/dataproxy/dataproxy.php (original) +++ trunk/plugins/dataproxy/dataproxy.php Sat Sep 13 15:59:15 2008 @@ -282,8 +282,12 @@ */ function escape($str) { - $str = html_entity_decode($str, ENT_QUOTES, $this->encoding); - return htmlentities($str, ENT_QUOTES, $this->encoding); + $str = str_replace( + array('<', '>', '&', '"', '''), + array( '<', '>', '&', '"', "'"), + $str + ); + return htmlspecialchars($str, ENT_QUOTES, $this->encoding); } /** @@ -547,7 +551,11 @@ */ function escape($str) { - $str = html_entity_decode($str, ENT_QUOTES, $this->encoding); - return htmlentities($str, ENT_QUOTES, $this->encoding); + $str = str_replace( + array('<', '>', '&', '"', '''), + array( '<', '>', '&', '"', "'"), + $str + ); + return htmlspecialchars($str, ENT_QUOTES, $this->encoding); } } Modified: trunk/plugins/dataproxy/functions.inc ============================================================================== --- trunk/plugins/dataproxy/functions.inc (original) +++ trunk/plugins/dataproxy/functions.inc Sat Sep 13 15:59:15 2008 @@ -260,9 +260,13 @@ /** * Returns a string escaped for output */ -function DPXY_esc() { - $str = html_entity_decode($str, ENT_QUOTES, DPXY_encoding()); - return htmlentities($str, ENT_QUOTES, DPXY_encoding()); +function DPXY_esc($str) { + $str = str_replace( + array('<', '>', '&', '"', '''), + array( '<', '>', '&', '"', "'"), + $str + ); + return htmlspecialchars($str, ENT_QUOTES, DPXY_encoding()); } /**