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

    Idea or Suggestion Re: backslashes stripped from product description?

    Quote Originally Posted by wilt View Post
    Does this happen with the standard text box for the description, or are you using the html editor text box?
    Standard text box for the description.

    In fact, as I was trying to type my workaround here (using HTML escape characters as one might find at theukwebdesigncompany.com/articles/entity-escape-characters.php) I found that the vBulletin input box here exhibits the same exact problem.

    I am now convinced that this is a PHP "feature", not a Zen-Cart specific issue.

  2. #12
    Join Date
    Sep 2009
    Posts
    78
    Plugin Contributions
    0

    help question Re: backslashes stripped from product description?

    I think that I discovered where this problem comes from. In includes/templates/template_default/templates/tpl_product_free_shipping_info_display.php (line 80) the product description is echoed through a stripslashes() filter:
    PHP Code:
     <!--bof Product description -->
    <?php if ($products_description != '') { ?>
    <div id="productDescription" class="freeShip biggerText"><?php echo stripslashes($products_description); ?></div>
    <?php ?>
    <!--eof Product description -->
    I am sure that this stripslashes() filter was placed there for a good reason. Can you shed some light on this?

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

    Default Re: backslashes stripped from product description?

    It got me curious why you were seeing a different effect from me so I had a look. This quote from the php manual may be the reason:

    Note: If magic_quotes_sybase is on, no backslashes are stripped off but two apostrophes are replaced by one instead.

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

    help question Re: backslashes stripped from product description?

    Quote Originally Posted by scatzc View Post
    I think that I discovered where this problem comes from. In includes/templates/template_default/templates/tpl_product_free_shipping_info_display.php (line 80) the product description is echoed through a stripslashes() filter:
    PHP Code:
     <!--bof Product description -->
    <?php if ($products_description != '') { ?>
    <div id="productDescription" class="freeShip biggerText"><?php echo stripslashes($products_description); ?></div>
    <?php ?>
    <!--eof Product description -->
    I am sure that this stripslashes() filter was placed there for a good reason. Can you shed some light on this?
    This "feature" is driving me nuts. Before hacking the PHP code to get rid of this, I would appreciate an explanation of the design consideration that led to placing stripslashes() there. I am assuming, of course, that it is not a bug but rather a thoughtful feature.

    Thanks.

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

    Idea or Suggestion Re: backslashes stripped from product description?

    Quote Originally Posted by niccol View Post
    Note: If magic_quotes_sybase is on, no backslashes are stripped off but two apostrophes are replaced by one instead.
    Update: I managed to workaround the problem (I am leery about hacking stable code that has been running for years, without fully understanding design considerations):

    I have been able to output a single backslash on the product description page by entering in the source HTML 8 consecutive bacslashes (eight!).

    For two adjacent backslashes I had to enter 16 consecutive bacslashes...

    Pretty amazing.

 

 
Page 2 of 2 FirstFirst 12

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