v2.10.12: backslashes in file path disappear from message

Discuss, research, share, find, and solve bugs

v2.10.12: backslashes in file path disappear from message

Postby kenh » 2:16am, Sat 09 Oct, 2010

First let me thank the developers for a very useful product. I am using version 2.10.12 through my ISP's Fantastico bundle.

My problem is that the last message I sent out had some examples that included a file path like this:

C:\Windows\SysWOW64\odbcad32.exe

When I saved the message the backslashes were gone. So I put them back in and when I saved they were gone again. So I put in double slashes and then saved. It went to single slashes. Next save removed them completely.

Does anyone else get this behavior? Is there a way to get the backslashes to stay?

Ken
kenh
phpList newbie
 
Posts: 4
Joined: 2:03am, Sat 09 Oct, 2010

Re: backslashes in file path disappear from message

Postby H2B2 » 12:06am, Sun 10 Oct, 2010

Yes, I can confirm this issue for HTML messages.

Plain text messages seem to be fine, at least when the 'manual text part' setting is enabled in config.php. Haven't tested automatic parsing into text messages.

I suppose stripslashes might be involved here.

Related mantis bug report: http://mantis.phplist.com/view.php?id=15551
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Re: backslashes in file path disappear from message

Postby duncanc » 7:40am, Sun 10 Oct, 2010

You are correct in thinking that the problem involves stripslashes. A similar problem also applies to the subject field.
Looking at the code, the problem with the message content seems to be caused by an unnecessary call to stripslashes when loading the fck editor window.
There is also a problem with stripslashes being called on data that is read from the message table as opposed to being submitted in a form. So even after fixing the first problem the slashes were lost after saving the message and then re-editing it. The code has this comment which is incorrect
Code: Select all
// If we've got magic quotes on, then we need to get rid of the slashes - either
// from the database or from the previous $_POST


Attached is a modified version of send_core.php for 2.10.12

1) removes slashes on the message and msgsubject fields only on a form submission, not when the data is retrieved from the message table, around line 106, and also 172

2) removes a stripslashes() call when loading the fck editor window, around line 1182

I have done some testing and it seems to work without any side effects. Similar changes might have to be made for other fields that can validly contain a '\' character such as the footer text.
Attachments
send_core.php.tar.gz
(16.23 KiB) Downloaded 241 times
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: backslashes in file path disappear from message

Postby H2B2 » 11:17am, Sun 10 Oct, 2010

Great! Thanks for the fix. Have updated related mantis report.

This could also be a _possible_ explanation for another issue, involving Japanese shift_jis and big5 encoded characters (used in Japanese and Chinese), some of which contain a backlash.
ref: http://mantis.phplist.com/view.php?id=11562
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006


Return to Bug Discussion

Who is online

Users browsing this forum: No registered users and 1 guest