<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Блог на Венелин Кочев &#187; stripslashes</title>
	<atom:link href="http://cyberroot.net/tag/stripslashes/feed/" rel="self" type="application/rss+xml" />
	<link>http://cyberroot.net</link>
	<description></description>
	<lastBuildDate>Mon, 12 Jul 2010 10:02:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>JavaScript addslashes/stripslashes</title>
		<link>http://cyberroot.net/2008/05/08/javascript-addslashes-stripslashes/</link>
		<comments>http://cyberroot.net/2008/05/08/javascript-addslashes-stripslashes/#comments</comments>
		<pubDate>Thu, 08 May 2008 12:45:42 +0000</pubDate>
		<dc:creator>Venelin Kochev</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[addslashes]]></category>
		<category><![CDATA[stripslashes]]></category>

		<guid isPermaLink="false">http://cyberroot.org/?p=13</guid>
		<description><![CDATA[Две алтернативи на функциите от PHP за JavaScript: function addslashes&#40;str&#41; &#123; str = str.replace&#40;/\'/g,'\\\''&#41;; str = str.replace&#40;/\&#34;/g,'\\&#34;'&#41;; str = str.replace&#40;/\\/g,'\\\\'&#41;; str = str.replace&#40;/\0/g,'\\0'&#41;; &#160; return str; &#125; &#160; function stripslashes&#40;str&#41; &#123; str = str.replace&#40;/\\'/g,'\''&#41;; str = str.replace&#40;/\\&#34;/g,'&#34;'&#41;; str = str.replace&#40;/\\\\/g,'\\'&#41;; str = str.replace&#40;/\\0/g,'\0'&#41;; &#160; return str; &#125;]]></description>
			<content:encoded><![CDATA[<p>Две алтернативи на функциите от PHP за JavaScript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> addslashes<span style="color: #009900;">&#40;</span>str<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\'/g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\'</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\&quot;/g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\\</span>&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\\/g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\\</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\0/g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\\</span>0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">return</span> str<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> stripslashes<span style="color: #009900;">&#40;</span>str<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\\'/g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\'</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\\&quot;/g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\\\\/g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\\</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\\0/g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\0</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">return</span> str<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p></p>
]]></content:encoded>
			<wfw:commentRss>http://cyberroot.net/2008/05/08/javascript-addslashes-stripslashes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
