You are here:  » Featured Products Admin and ' Character


Featured Products Admin and ' Character

Submitted by paddyman on Tue, 2011-09-13 20:29 in

Hi David,

Loving the wordpress plugin, great work :)

Having some problems with the ' character in the featured products admin page. If products contain the ' character such as The King's Speech, when I put this product in the Featured Product Names box and click save I get - The King\\\\\\\'s Speech, with the amount of backslashes increasing as I click save.

Hope I'm making sense !!

Cheers

Adrian

Submitted by support on Wed, 2011-09-14 06:21

Hi Adrian,

That's a function of PHP's "magic quotes" feature which automatically "escapes" (adds a backslash) when an apostrophe appears in a POSTed form data. Prior to distribution 12/10B there was a bug in the way Price Tapestry detected and handled this - it was the wrong way round basically! In your includes/widget.php look for this function beginning at around line 111:

  function widget_posted($text)
  {
    if (get_magic_quotes_runtime())
    {
      return $text;
    }
    else
    {
      return stripslashes($text);
    }
  }

...and REPLACE that with:

  function widget_posted($text)
  {
    if (get_magic_quotes_runtime())
    {
      return stripslashes($text);
    }
    else
    {
      return $text;
    }
  }

That should be all it is!

Cheers,
David.