Menu

#16 Admin Email Templates display escape slashes

1.0
closed
None
2.6.2
2.6.0
2017-01-06
2017-01-04
No

Think that there might be a bug in settings.php page.
When you have a ' or " in the email template text it gets escaped when writing to the data base, whihc is good.
However when it gets displayed again it shows the leading slash.
Each time you save the settings you get an extra slash...

\\\\"Show only my events\\\\\"

Could the settings be un-escaped or have the slashed removed when they are displayed?

Thanks.

Discussion

  • Benjamin Schmitt

    I cannot reproduce this behaviour. I am using firefox on windows,
    Server is
    - hosted on a SunOS (unix) machine,
    - running php 5.5.38 and
    - mysql 5.5.52

    I have inserted "Show only my events" to all five email template fields, saved, reloaded - nothing unusual happend.

    So, please send me detailed steps, what you have done, what you have inserted, etc.
    including version infos of php, mysql, server os, client browser, client os.

     
  • Benjamin Schmitt

    • Used Version: --> 2.6.0
     
  • Stephen Greenslade

    Hi Ben,

    My site is:

    • Hosted: Linux Server. In a cPanel account
    • PHP 5.3.29
    • Mysql 5.6.34

    Here is what I did:

    • I edited the email templates.
    • Added "Show only my events" to the Email to new users box
    • Clicked Update all.
    • Expanded the Email templates Tab
    • The Text now has \"Show only my events\"
    • If I update again, the text shows \"Show only my events\"

    Each time I save I get extra \ characters.

    Thanks

     
  • Benjamin Schmitt

    Ok, does not reproduce for me either.
    But according to docs, it seems to be dependend on chosen charset.
    http://de2.php.net/manual/en/function.mysql-real-escape-string.php

    Yet, I've read there: when using mysql_real_escape_string I need to un-escape via stripslashes.
    Something that was not in the 2.6.0 code.
    I am currently changing that.
    I guess I have to check the complete code for that.
    Also the used mysql functions are deprecated - this needs to be replaced at some point too (not now).

    During the evening I have made some further changes, I have uploaded the current code to project's svn repository (V2.6.1, Rev 47). Maybe you could update from there and test it. If everything is fine, and after some testing on my side too, I might do a file release the next days.

     

    Last edit: Benjamin Schmitt 2017-01-05
  • Stephen Greenslade

    Hi Ben,

    Hey many thanks for looking into this and for adding a fix ;-)
    I'll pull down the latest code and give it a go.

    Cheers

    Steve

     
  • Stephen Greenslade

    Hi Ben,

    I've pulled the latest code from the Git repo and this issue is now fixed.
    (Great idea to move to Git by the way... I've forgotten how to use SVN)

    Cheers

    Steve

     
  • Benjamin Schmitt

    • status: open --> closed
    • Fixed in: --> 2.6.2
     
  • Benjamin Schmitt

    nice, thanks for testing and reporting.
    Yeah, I am also more used to GitHub now.

     

Log in to post a comment.