Problem with german Umlauts and safe_mailto in cms page editor

edited January 2016 in Bug Reports
Hi,

I have a cms page where I have some contact data. The emailadresses are encoded via safe_mailto function.
Now I have one entry
safe_mailto("abc@test.de", "Wehrführung")
On saving the cms page the entry is transformed to
safe_mailto("abc@test.de", "Wehrführung")

On the frontend page then the text Wehrführung is displayed instead of Wehrführung.
I think this is because the browser doesn't get the html special char in safe_mailto encoded way, but interprets each single character.

Any idea how to solve this issue?

Comments

  • edited 3:39AM
    As a workaround I copied the safe_mailto to a custom function in my_url_helper and replace german umlauts html represenations in $title before encoding the whole thing... seems to work :-)
  • edited 3:39AM
    By default, the fuel pages module has the 'sanitize_input' module parameter of:
    'sanitize_input' => array('template','php'),
    The "template and "php" map to sanitization functions. The mapping is done by the 'module_sanitize_funcs' config function that you can modify as well to point to a different function:
    // Functions that can be used for the sanitize_input value on a basic module. // The key of the array is what should be used when configuring your module $config['module_sanitize_funcs'] = array( 'xss' => 'xss_clean', 'php' => 'encode_php_tags', 'template' => 'php_to_template_syntax', 'entities' => 'htmlentities' );

    You could additionally use a module overwrite to change the 'sanitize_input' parameters for the pages module:
    http://docs.getfuelcms.com/modules/simple#overwrites
  • edited 3:39AM
    sorry, but i don't understand how to solve this problem. I've got this same with polish letters: ą ć ę ł ń ó ś ź ż
    can u explain more widely, how to solve this problem?
  • edited 3:39AM
    I forgot to write,that i've met with this problem when i'm putting content by the CMS to any page, after page is saved, editor page reloaded, i see all my polish letters replaced by codes.... any workaround? :-/
  • edited 3:39AM
    It looks like in this case it has to do with the MY_Model::auto_encode_entities property which is set to TRUE for the fuel_pagevariables_model. You can overwrite this by creating your own model in fuel/application/models/My_pagevariables_model.php that simply extends the Fuel_pagevariables_model and overwrites that property:
    require_once(FUEL_PATH.'models/fuel_pagevariables_model.php'); class My_pagevariables_model extends Fuel_pagevariables_model { public $auto_encode_entities = FALSE; }
    And then you can create the overwrite as explained here:
    http://docs.getfuelcms.com/modules/simple#overwrites
  • edited 3:39AM
    many thanks for reply, i will try it tomorrow and confirm if my problem dissapears.
  • edited 3:39AM
    Admin, for now it works perfectly.
Sign In or Register to comment.