Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Sep 2009
    Posts
    78
    Plugin Contributions
    0

    red flag backslashes stripped from product description?

    I have this weird problem in which everything I tried (including doubling doubling the backslashes) doesn't solve the problem: Zen-Cart seems to strip all backslashes from the product description.

    Case in question: I am trying to include in the product description the following string:
    \\myfileserver\mynetworkshare
    Upon entering the product description (via Admin console) the backslashes disappear!

    I tried entering
    \\\\myfileserver\\mynetworkshare
    but this didn't help.

    I tried using enclosing this in PHP's specialhtmlchars() and that didn't help either - It seems that Zen-Cart strips those backslashes just before being stored in the database.

    Any idea how to overcome this?

    Thanks!

  2. #2
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: backslashes stripped from product description?

    Have you tried using \ instead of a backslash?

  3. #3
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: backslashes stripped from product description?

    Ha ha that doesn't work I will put spaces in between the characters

    Have you tried using '& # 9 2 ;' ? Without the spaces, obviously!

  4. #4
    Join Date
    Sep 2009
    Posts
    78
    Plugin Contributions
    0

    bug Re: backslashes stripped from product description?

    Quote Originally Posted by niccol View Post
    Have you tried using '& # 9 2 ;' ? Without the spaces, obviously!
    Yes, I did - didn't help either.

    Before posting here, I tried searching the subject and found only one thread - unanswered really:

    http://www.zen-cart.com/forum/showthread.php?t=80192


    Is it possible that this is a bug in Zen-Cart?

  5. #5
    Join Date
    Sep 2009
    Posts
    78
    Plugin Contributions
    0

    help question Re: backslashes stripped from product description?

    I forgot to ask the obvious: Am I the only one having this problem? Can you also see (or reproduce) the problem on your systems by entering a product description with one or more backslashes?

  6. #6
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: backslashes stripped from product description?

    No, it works fine on my test server. In other words if I enter\\ I get a single \. If I enter \\\\ I get two. Which is kind of what you would expect. Don't know enough about servers to really give you advice beyond that.....

  7. #7
    Join Date
    Sep 2009
    Posts
    78
    Plugin Contributions
    0

    help question Re: backslashes stripped from product description?

    Quote Originally Posted by niccol View Post
    No, it works fine on my test server. In other words if I enter\\ I get a single \. If I enter \\\\ I get two. Which is kind of what you would expect.
    This is what I would expect, too. Thank you Nick for your answers.

    This is troubling. What could have I possibly done in my system that would have introduced this problem?

    Could this be a PHP version or configuration issue? Something specific not to Zen-Cart but rather to my web host?

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: backslashes stripped from product description?

    Do you have the backslashes disappearing when you first enter and save the text in your description? I know that if you edit a description after entering and saving it, special character formatting will often go away.

  9. #9
    Join Date
    Sep 2009
    Posts
    78
    Plugin Contributions
    0

    help question Re: backslashes stripped from product description?

    Quote Originally Posted by gjh42 View Post
    Do you have the backslashes disappearing when you first enter and save the text in your description?
    Yes. That is exactly the case.

    When I first enter 4 consecutive backslashes into the product description I can still see them intact:
    \\\\fileserver\\networkshare
    Once I press the Preview button, every 2 backslashes turn into 1 - this is fine with me and I can understand and work with that:
    \\fileserver\networkshare
    But then when I press the Update button, it seems that this "divide-by-two" process repeates:
    \fileservernetworkshare
    Note how the single backslash after Preview disappeared but the n after it didn't (i.e. it wasn't treated like a \n = newline but rather the backslash only disappeared).

    Is this a PHP feature? A bug?

  10. #10
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,927
    Plugin Contributions
    4

    Default Re: backslashes stripped from product description?

    Does this happen with the standard text box for the description, or are you using the html editor text box?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 11 Aug 2013, 04:09 PM
  2. Link from product description page
    By Jockey in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 11 Dec 2008, 06:24 PM
  3. Removing product description from product list
    By amaroczek in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 8 Dec 2008, 11:42 PM
  4. how to change " getting stripped from page titles?
    By lankeeyankee in forum General Questions
    Replies: 4
    Last Post: 28 Feb 2008, 04:05 PM
  5. Backslash gets stripped from Product_Model
    By LuMe96 in forum Basic Configuration
    Replies: 4
    Last Post: 16 Nov 2007, 09:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg