Jump to content

Bug? Escaping lost during post edits.


Recommended Posts

I think this just started happening recently - at least I didn't notice it before. When editing a post where characters are escaped, the left backslash is removed from the text when the post is opened for editing. The result is that if you make a change to a post and don't put the backslashes back in, the new post will be in error.

 

Example:

 

I create a post such as this (everything dislayes fine)

Sample Code:

echo "<a href=\"somepage.php\">Go</a>"

 

However, if I then go to edit that post, this is what is displayed in the textarea field (note backslashes are gone):

Sample Code:
[code=php:0]echo "<a href="somepage.php">Go</a>"

[/code]

 

If I make changes and don't put the backslashes back in the new post will look like this (incorrect):

Sample Code:

echo "<a href="somepage.php">Go Now</a>"

Edit: updated link text

Link to comment
Share on other sites

echo "<div id="foo">bar</div>";

 

Initial save with IE: OK

Edit with IE: Backslashes lost

--Correct backslashes

Save with FF:OK

Edit with FF: Backslashes lost

 

Hmm, not sure what is different between you and I, but I am consistently losing the backslashes when the text is populated into the text area when I use the option to edit.

 

Edit: Getting the same results on a different PC

Link to comment
Share on other sites

I think this just started happening recently - at least I didn't notice it before. When editing a post where characters are escaped, the left backslash is removed from the text when the post is opened for editing. The result is that if you make a change to a post and don't put the backslashes back in, the new post will be in error.

 

 

Welcome to my world.. I have brought this up before in this forum (seems hard to reproduce for some people?). I have posting issues all the time in Chrome (but funny, it wasn't an issue a month ago (give or take a few weeks). I tested post previewing in Chome, and many problems.. in Firefox, not so much (but not perfect). I then dowloaded and installed Opera 10 Beta 2. Flawless.. so now when I post code, I tend to do it from Opera instead of Chrome / firefox.

 

But just to make sure, I used Chrome and Firefox in other websites to preview code snippets.. no issues at all.. so it is this site that is causing this for sure. So if you want flawless issues, try Opera 10.

 

EDIT - My thread about the issues are here:http://www.phpfreaks.com/forums/index.php/topic,258343.0.html

Link to comment
Share on other sites

My initial test in this thread was done within Safari on the Mac, testing now in FireFox 3 under Ubuntu, though this sounds more like a server-side issue.

 

<?php echo "<div id=\"foo\">bar</div>"; ?>

echo "<div id=\"foo\">bar</div>";

 

EDIT: Still works OK for me.

Link to comment
Share on other sites

I am experiencing this with the "Modify" link that appears at the top-right of a post after you post an item (right next to the quote link). I agree this sounds like a server-side issue as the client would have nothing to do with the text that get's populated into the text area when the user selects to edit a post.

 

echo "<a href=\"test.php\">Link</a>";

Link to comment
Share on other sites

Ah, you meant 'Modify'.. here I was looking for explicitly the 'quick edit' button...

I'll test that in a minute.. for me, the problem (missing backslahses) occur when dealing with previewing.. I don't think there is an issue if I go straight from Quick Reply to Post.

 

Testing:

echo (preg_match('#^w+$#', $str3))? $str3 . ' passes regex w!' . "<br /> ":  $str3 . ' does NOT pass ctype_digit()' . "<br /> ";

EDIT- Modifying does wipe out backslashes for me...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.