Output filter to remove windows specific chararcters
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 27 Jan 2007 17:53:38 +0000 (17:53 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 27 Jan 2007 17:53:38 +0000 (17:53 +0000)
& some fixes

git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1414 839d8a87-29fc-0310-9880-83ba4fa771e5

classes/env.php
classes/platalpage.php
classes/plmailer.php
include/xorg.misc.inc.php
templates/core/bug.tpl

index 938596c..a40538c 100644 (file)
@@ -162,7 +162,7 @@ function fix_gpc_magic(&$item, $key) {
         $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)) {
index 1c91502..26f1ee6 100644 (file)
@@ -304,6 +304,8 @@ function _hide_email($source)
 
 function hide_emails($source, &$smarty)
 {
+    fix_encoding($source);
+
     //prevent email replacement in <script> and <textarea>
     $tags = array('script', 'textarea', 'select');
 
index 0cb0b81..f66ac89 100644 (file)
@@ -53,7 +53,9 @@ class PlMail extends Smarty
     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 */
index 18722fc..6e99ade 100644 (file)
@@ -112,7 +112,10 @@ function make_forlife($prenom,$nom,$promo) {
 }
 
 function check_ip($level)
-{   
+{
+    if (empty($_SERVER['REMOTE_ADDR'])) {
+        return 0;
+    } 
     $test = array();
     switch ($level) {
       case 'unsafe': $test[] = "state = 'unsafe'";
index d517368..e3059f6 100644 (file)
@@ -37,7 +37,7 @@ function cleanContent()
 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