$item = stripslashes($item);
}
}
-function fix_encoding(&$item, $key) {
+function fix_encoding(&$item, $key = null) {
if (is_array($item)) {
array_walk($item, 'fix_encoding');
} elseif (preg_match('/[\x80-\x9f]/', $item)) {
function hide_emails($source, &$smarty)
{
+ fix_encoding($source);
+
//prevent email replacement in <script> and <textarea>
$tags = array('script', 'textarea', 'select');
public function run($html)
{
$this->assign('html_version', $html);
- return $this->fetch($this->tpl);
+ $text = $this->fetch($this->tpl);
+ fix_encoding($text);
+ return $text;
}
/** used to remove the empty lines due to {from ...}, {to ...} ... functions */
}
function check_ip($level)
-{
+{
+ if (empty($_SERVER['REMOTE_ADDR'])) {
+ return 0;
+ }
$test = array();
switch ($level) {
case 'unsafe': $test[] = "state = 'unsafe'";
function fillContent()\r
{\r
var field = document.getElementById('flyspray_detail');\r
- if (field.value == '' || field.value.toUpperCase() == field.value) {\r
+ if (field.value == '' || (field.value.toUpperCase() == field.value && field.value.toLowerCase() == field.value)) {\r
field.value = "** Explique ici le problème ou l'amélioration proposée **";\r
field.style.color = "gray";\r
field.style.textAlign = "center";\r