<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 18: Escaped characters in snippets</title><link>https://sourceforge.net/p/php-csl/bugs/18/</link><description>Recent changes to 18: Escaped characters in snippets</description><atom:link href="https://sourceforge.net/p/php-csl/bugs/18/feed.rss" rel="self"/><language>en</language><lastBuildDate>Sun, 25 Dec 2005 02:28:23 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/php-csl/bugs/18/feed.rss" rel="self" type="application/rss+xml"/><item><title>Escaped characters in snippets</title><link>https://sourceforge.net/p/php-csl/bugs/18/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Escaped characters in snippets lose the back slash when&lt;br /&gt;
editing the snippet:&lt;/p&gt;
&lt;p&gt;$sString .= "\n";&lt;/p&gt;
&lt;p&gt;would become, when opened for editing:&lt;/p&gt;
&lt;p&gt;$sString .= "n";&lt;/p&gt;
&lt;p&gt;I figure it may be something to do with magic quotes,&lt;br /&gt;
which are currently turned off on my installation of&lt;br /&gt;
php? I added the following to my copy (0.91) and it&lt;br /&gt;
seems ok now..&lt;br /&gt;
at the end of functions.php, i added a function:&lt;/p&gt;
&lt;p&gt;function rtStripSlashes($sString) {&lt;br /&gt;
# returns string that has slashes stripped if magic&lt;br /&gt;
quotes are on&lt;br /&gt;
if (ini_get('magic_quotes_runtime')) {&lt;br /&gt;
return stripslashes($sString);&lt;br /&gt;
} else {&lt;br /&gt;
return $sString;&lt;br /&gt;
}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;in file snips_edit.php, changed lines 50,51 to call&lt;br /&gt;
this function instead of stripslashes():&lt;/p&gt;
&lt;p&gt;echo '&amp;lt;b&amp;gt;Edit Syntax below:&amp;lt;/b&amp;gt;&amp;lt;/br&amp;gt;&amp;lt;textarea&lt;br /&gt;
name=syntax rows=16&lt;br /&gt;
cols=60&amp;gt;'.rtStripSlashes(htmlspecialchars($syntax)).'&amp;lt;/textarea&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;br /&gt;
class="fr1"&amp;gt;';&lt;br /&gt;
echo '&amp;lt;b&amp;gt;Edit Description below:&amp;lt;/b&amp;gt;&amp;lt;/br&amp;gt;&amp;lt;textarea&lt;br /&gt;
name=description rows=10&lt;br /&gt;
cols=60&amp;gt;'.rtStripSlashes(htmlspecialchars($description)).'&amp;lt;/textarea&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;br /&gt;
class="fr2" align=center&amp;gt;';&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mathew</dc:creator><pubDate>Sun, 25 Dec 2005 02:28:23 -0000</pubDate><guid>https://sourceforge.net6302e93c07d4e795e1c43a2e4e7038075092fa7f</guid></item></channel></rss>