Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Rich Text fields getting extra escape slashes 22 Aug 2013 20:01 #10889

I have a rich text field and in the HTML double quotes (") are getting escaped with a slash and that is causing problems because they are not getting removed.

my temporary work around is to add the following code to the prepare table function in the model (using a fork):
$table->description = str_replace('\"', '"', $table->description);

I'm no expert here, and I haven't dug into this, but seems the field does need to processed to avoid SQL injection problems but not sure if double quotes need to be escaped? if so, then somewhere the slash needs to be removed. Having said that, I wonder if the code is using PHP addslashes() instead of something like the mysqli_real_escape_string() function to prepare the data?

Thanks!
Dave

Please Log in or Create an account to join the conversation.

Rich Text fields getting extra escape slashes 07 Oct 2013 23:28 #11320

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Sorry for answering late. I never got this problem ever.

Wich Joomla ?
Wich Editor ?

Both front and back ?

Did you tried to switch editor ?
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Last edit: by admin.

Rich Text fields getting extra escape slashes 12 Nov 2014 00:02 #12761

I am having this same problem. This was not a problem in an earlier version of my app running on the same server as the latest version. Anytime I save items with a rich text field, the quote marks are escaped.

I enter the following code:
<p><img src="/images/Demo/iZ3.jpg" alt="" width="1368" height="768" /></p>

Press SAVE and the get the following code back:
<p><img src=\"/images/Demo/iZ3.jpg\" alt=\"\" width=\"1368\" height=\"768\" /></p>

I tried changing editors and even used the No Editor option. I tried it from both the front and back end and got the same results. I tried it with different user accounts (registered & special).

Running Joomla 2.5.27
Editors: No Editor and JCE

When I tested this in the sandbox, it does not happen.

Any ideas?

ADDITIONAL
I just tried to save an item multiple times in a row and fond that the problem becomes worse every time I save the item.
<p><img src=\\\\\"/images/Demo/iZ3.jpg\\\\\" alt=\\\\\" \\\\\"  width=\\\\\" 1368\\\\\"  height=\\\\\" 768\\\\\"  /></p>

Please Log in or Create an account to join the conversation.

Last edit: by rholzler. Reason: Additional information.

Rich Text fields getting extra escape slashes 12 Nov 2014 00:30 #12763

[SOLVED]

I reviewed the PHP settings and found that magic quotes were on. I added the following to the .htaccess file and the problem is fixed!
php_flag magic_quotes_gpc off

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.060 seconds

A HUGE thank you for all the time and effort you have put into J-Cook it is a timesaver and a training tool all in one
Morgan Leecy - MCSE  

Get Started