Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Whats wrong with encoding?
#11
I have looked at the code and managed to fix the behavior for me, it comprised of following 2 steps:

Replacing htmlentities with htmlspecialchars when saving the page - in admin/changedata.php

Setting the ckeditor to not encode diacritics as entities:
- to admin/template/js/ckeditor/config.js add
Code:
config.entities = false;
config.entities_greek = false;
config.entities_latin = false;
config.entities_processNumerical = false;


A patch for actual SVN version is here:

Code:
Index: admin/changedata.php
===================================================================
--- admin/changedata.php    (revision 9)
+++ admin/changedata.php    (working copy)
@@ -86,15 +86,15 @@
         $file = GSDATAPAGESPATH . $url .".xml";
        
         // format and clean the responses
-        if(isset($_POST['post-title'])) { $title = htmlentities($_POST['post-title'], ENT_QUOTES, 'UTF-8'); }
-        if(isset($_POST['post-metak'])) { $metak = htmlentities($_POST['post-metak'], ENT_QUOTES, 'UTF-8'); }
-        if(isset($_POST['post-metad'])) { $metad = htmlentities($_POST['post-metad'], ENT_QUOTES, 'UTF-8'); }
+        if(isset($_POST['post-title'])) { $title = htmlspecialchars($_POST['post-title'], ENT_QUOTES, 'UTF-8'); }
+        if(isset($_POST['post-metak'])) { $metak = htmlspecialchars($_POST['post-metak'], ENT_QUOTES, 'UTF-8'); }
+        if(isset($_POST['post-metad'])) { $metad = htmlspecialchars($_POST['post-metad'], ENT_QUOTES, 'UTF-8'); }
         if(isset($_POST['post-template'])) { $template = $_POST['post-template']; }
         if(isset($_POST['post-parent'])) { $parent = $_POST['post-parent']; }
-        if(isset($_POST['post-menu'])) { $menu = htmlentities($_POST['post-menu'], ENT_QUOTES, 'UTF-8'); }
+        if(isset($_POST['post-menu'])) { $menu = htmlspecialchars($_POST['post-menu'], ENT_QUOTES, 'UTF-8'); }
         if(isset($_POST['post-menu-enable'])) { $menuStatus = "Y"; } else { $menuStatus = ""; }
         if(isset($_POST['post-private'])) { $private = "Y"; } else { $private = ""; }
-        if(isset($_POST['post-content'])) { $content = htmlentities($_POST['post-content'], ENT_QUOTES, 'UTF-8'); }
+        if(isset($_POST['post-content'])) { $content = htmlspecialchars($_POST['post-content'], ENT_QUOTES, 'UTF-8'); }
        
         if(isset($_POST['post-menu-order']))
         {
Index: admin/template/js/ckeditor/config.js
===================================================================
--- admin/template/js/ckeditor/config.js    (revision 9)
+++ admin/template/js/ckeditor/config.js    (working copy)
@@ -8,4 +8,8 @@
     // Define changes to default configuration here. For example:
     // config.language = 'fr';
     // config.uiColor = '#AADC6E';
+    config.entities = false;
+    config.entities_greek = false;
+    config.entities_latin = false;
+    config.entities_processNumerical = false;
};
Reply


Messages In This Thread
Whats wrong with encoding? - by kotos - 2009-11-16, 23:01:44
Whats wrong with encoding? - by Zegnåt - 2009-11-17, 01:19:48
Whats wrong with encoding? - by kotos - 2009-11-17, 20:10:14
Whats wrong with encoding? - by Zegnåt - 2009-11-17, 22:44:55
Whats wrong with encoding? - by kotos - 2009-11-18, 02:13:20
Whats wrong with encoding? - by someone - 2010-01-23, 10:47:18
Whats wrong with encoding? - by Nijikokun - 2010-01-23, 13:07:26
Whats wrong with encoding? - by someone - 2010-01-29, 01:41:52
Whats wrong with encoding? - by Zegnåt - 2010-01-29, 05:08:25
Whats wrong with encoding? - by keff - 2010-06-10, 09:45:03
Whats wrong with encoding? - by keff - 2010-06-10, 10:05:30
Whats wrong with encoding? - by xseoer - 2010-06-10, 11:51:56
Whats wrong with encoding? - by Zegnåt - 2010-06-10, 16:48:16



Users browsing this thread: 1 Guest(s)