summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schneider2012-03-20 17:18:20 +0000
committerChristian Schneider2012-03-20 17:18:20 +0000
commit8a9d596c3c9e112025e594bff402a479c149c2d9 (patch)
treeb0b430df897a49c108e4ac3218ab308ccd202bae
parent5781eba8b158ecb3fc6d62ebe13223168534e862 (diff)
downloaditools-8a9d596c3c9e112025e594bff402a479c149c2d9.tar.gz
itools-8a9d596c3c9e112025e594bff402a479c149c2d9.tar.bz2
itools-8a9d596c3c9e112025e594bff402a479c149c2d9.zip
Explicitely give encoding for htmlspecialchars for PHP 5.4 compatibility
-rw-r--r--it_dbi.class4
-rw-r--r--it_debug.class4
-rw-r--r--it_html.class4
-rw-r--r--it_xml.class4
4 files changed, 8 insertions, 8 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 50f08b9..1303323 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -423,8 +423,8 @@ function clear($pp = true)
{
foreach ((array)$this->_fields + (array)$this->_localizedfields as $field => $dummy)
unset($this->$field);
- unset($this->_data);
- unset($this->_key);
+ unset($this->_key, $this->_data);
+
$pp && $this->_read_post_process();
}
diff --git a/it_debug.class b/it_debug.class
index ec6de07..6050cf0 100644
--- a/it_debug.class
+++ b/it_debug.class
@@ -143,7 +143,7 @@ function dump($args)
$item = "$red$item$nored";
if (isset($_SERVER['REMOTE_ADDR']) && !$plain) # html encode content and link any urls
- $item = htmlspecialchars($item);
+ $item = htmlspecialchars($item, ENT_COMPAT, ini_get('default_charset'));
if (preg_match('/^[\'"]/', $var))
$r .= "$item ";
@@ -158,7 +158,7 @@ function dump($args)
$r = str_repeat(" ", count(debug_backtrace(@constant('DEBUG_BACKTRACE_IGNORE_ARGS')))-3) . $r;
# not it_html::Q(); we dont wanna load it_html in ultraclassloader debugging
- $title = htmlspecialchars(it_debug::backtrace(array('skiplevels' => 1)));
+ $title = htmlspecialchars(it_debug::backtrace(array('skiplevels' => 1)), ENT_COMPAT, ini_get('default_charset'));
if (isset($_SERVER['REMOTE_ADDR']) && !$plain)
return "<pre title='$title' style='color:#c00; text-align:left; background-color:white; margin:0 0 0.4em; padding:0 0 0.4em 0; border-bottom:1px solid #ddd'>$r</pre>\n";
diff --git a/it_html.class b/it_html.class
index 9203c98..92aa9ba 100644
--- a/it_html.class
+++ b/it_html.class
@@ -296,7 +296,7 @@ function _tag($name, $args)
else if (isset($value) && $value !== true) # normal case: value
{
if (preg_match('/[<>&"\x00-\x08\x0a-\x0c\x0e-\x1f\x80-\x9f]/', $value)) # WARNING: copy/pasted from Q()
- $result .= " $key=\"" . str_replace("\n", "&#10;", htmlspecialchars($GLOBALS['it_html']->p['charset'] == "iso-8859-1" ? it_html::latinize($value) : $value)) . '"';
+ $result .= " $key=\"" . str_replace("\n", "&#10;", htmlspecialchars($GLOBALS['it_html']->p['charset'] == "iso-8859-1" ? it_html::latinize($value) : $value, ENT_COMPAT, $GLOBALS['it_html']->p['charset'])) . '"';
else
$result .= " $key=\"$value\"";
}
@@ -477,7 +477,7 @@ function latinize($string)
function Q($string)
{
if (preg_match('/[<>&"\x00-\x08\x0a-\x0c\x0e-\x1f\x80-\x9f]/', $string)) # WARNING: copy/pasted to _tag()
- $string = htmlspecialchars($GLOBALS['it_html']->p['charset'] == "iso-8859-1" ? it_html::latinize($string) : $string);
+ $string = htmlspecialchars($GLOBALS['it_html']->p['charset'] == "iso-8859-1" ? it_html::latinize($string) : $string, ENT_COMPAT, $GLOBALS['it_html']->p['charset']);
return $GLOBALS['debug_q'] && $string ? "<span style='background:#8FF'>$string</span>" : $string;
}
diff --git a/it_xml.class b/it_xml.class
index 4c9cb1c..0679c69 100644
--- a/it_xml.class
+++ b/it_xml.class
@@ -269,7 +269,7 @@ function to_xml($p = array())
$p['nextindentation'] .= $p['indent'];
foreach ((array)$this->attr as $key => $value)
- $tag .= " $key=\"" . htmlspecialchars($value) . '"';
+ $tag .= " $key=\"" . htmlspecialchars($value, ENT_COMPAT, ini_get('default_charset')) . '"';
$vars = get_object_vars($this);
@@ -302,7 +302,7 @@ function to_xml($p = array())
}
}
else if ($key == 'val')
- $body .= htmlspecialchars($values);
+ $body .= htmlspecialchars($values, ENT_COMPAT, ini_get('default_charset'));
}
}