refactored esclfhtml function to avoid ASCII string output and removing NL
[brisk.git] / web / Obj / brisk.phh
index 7fa2f36..344b30e 100644 (file)
@@ -395,10 +395,9 @@ function eschtml($s)
 
 function esclfhtml($s)
 {
-    return str_replace("\n", "<br>\n", htmlentities($s));
+    return str_replace("\n", "<br>", htmlspecialchars($s));
 }
 
-
 function langtolng($lang)
 {
   GLOBAL $G_lang;
@@ -759,7 +758,7 @@ class Client_prefs {
         fprintf(STDERR, "QQ %s: %x\n", __FUNCTION__, $user->flags);
         $this->listen = ($user->flags & USER_FLAG_MAP_AUTH) >> 2;
         if ($user->rec != FALSE) {
-            $this->supp_comp = $user->rec->supp_comp;
+            $this->supp_comp = $user->rec->supp_comp_get();
         }
         else {
             $this->supp_comp = "000000000000";
@@ -811,10 +810,10 @@ class Client_prefs {
         fprintf(STDERR, "QQ %s::%s %x\n", __CLASS__, __FUNCTION__,
                 $user->flags);
         if ($user->is_supp_custom()) {
-            $user->rec->supp_comp = $this->supp_comp;
+            $user->rec->supp_comp_set($this->supp_comp);
         }
         if ($is_save)
-            $user->store_set();
+            $user->prefs_store();
     }
 }
 
@@ -2262,7 +2261,7 @@ class Room
 
       // sql record exists AND last donate > 2013-01-01
       if ($this->user[$i]->is_supp_custom()) {
-          $supp_comp_s = sprintf(', "%s"', $this->user[$i]->rec->supp_comp);
+          $supp_comp_s = sprintf(', "%s"', $this->user[$i]->rec->supp_comp_get());
       }
       else {
           $supp_comp_s = '';
@@ -2310,7 +2309,7 @@ class Room
         
         log_main($user_cur->name. sprintf(" IN TABLE [%d]", $table_idx));
         if ($user_cur->is_supp_custom())
-            $supp_comp_s = sprintf(', "%s"', $user_cur->rec->supp_comp);
+            $supp_comp_s = sprintf(', "%s"', $user_cur->rec->supp_comp_get());
         else
             $supp_comp_s = '';