<?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>Naufraghi nella rete &#187; php</title>
	<atom:link href="http://www.slug.it/naufraghi/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.slug.it/naufraghi</link>
	<description>… dolce m’è il naufragar in questo mare?</description>
	<lastBuildDate>Fri, 06 Aug 2010 15:50:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Lavoro</title>
		<link>http://www.slug.it/naufraghi/lavoro/</link>
		<comments>http://www.slug.it/naufraghi/lavoro/#comments</comments>
		<pubDate>Sat, 04 Nov 2006 09:39:14 +0000</pubDate>
		<dc:creator>Matteo</dc:creator>
				<category><![CDATA[informatica]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software libero]]></category>

		<guid isPermaLink="false">http://www.slug.it/naufraghi/lavoro/</guid>
		<description><![CDATA[Ho cominciato a lavorare! Lavoro per la [Develer](http://www.develer.com/), azienda di sviluppo software e non solo, credo di aver capito specializzata nel non specializzarsi. Sono stato assegnato ad un progetto interno un po&#8217; noioso che consiste nell&#8217;adattare [Achievo](http://www.achievo.org/) per consentire la visione delle statistiche delle ore lavorate anche ai clienti, limitando l&#8217;accesso ai soli progetti a [...]]]></description>
			<content:encoded><![CDATA[<p>Ho cominciato a lavorare! Lavoro per la [Develer](http://www.develer.com/), azienda di sviluppo software e non solo, credo di aver capito specializzata nel non specializzarsi.</p>
<p>Sono stato assegnato ad un progetto interno un po&#8217; noioso che consiste nell&#8217;adattare [Achievo](http://www.achievo.org/) per consentire la visione delle statistiche delle ore lavorate anche ai clienti, limitando l&#8217;accesso ai soli progetti a cui i clienti sono interessati.</p>
<p>Nel farlo ho notato che Achievo è un po&#8217; limitato nell&#8217;interfaccia di gestione delle ore lavorate, prevede l&#8217;inserimento di un giorno e di un numero di ore.</p>
<p>Lavorando con orari liberi in Develer, il totale ore è spesso la somma di strani intervalli, tipo *10:30-12:30 + 13:50-19:20*</p>
<p><span id="more-176"></span></p>
<p>E qua Python viene in aiuto fornendo gli strumenti per creare un banale parser:</p>
<div class="codesnip-container" >
<div class="python codesnip" style="font-family:monospace;"><span class="kw1">import</span> <span class="kw3">datetime</span>, <span class="kw3">time</span></p>
<p><span class="kw1">def</span> parse_hhmm<span class="br0">&#40;</span>val<span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">datetime</span>.<span class="kw3">datetime</span><span class="br0">&#40;</span><span class="sy0">*</span><span class="kw3">time</span>.<span class="me1">strptime</span><span class="br0">&#40;</span>val, <span class="st0">&quot;%H:%M&quot;</span><span class="br0">&#41;</span><span class="br0">&#91;</span>:-2<span class="br0">&#93;</span><span class="br0">&#41;</span></p>
<p><span class="kw1">def</span> parse_hinterval<span class="br0">&#40;</span>val<span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; val1, val2 = val.<span class="me1">split</span><span class="br0">&#40;</span><span class="st0">&quot;-&quot;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; d1 = parse_hhmm<span class="br0">&#40;</span>val1<span class="br0">&#41;</span><br />
&nbsp; &nbsp; d2 = parse_hhmm<span class="br0">&#40;</span>val2<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> d2 <span class="sy0">&lt;</span> d1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; d2 += <span class="kw3">datetime</span>.<span class="me1">timedelta</span><span class="br0">&#40;</span>1<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> d2 &#8211; d1</p>
<p><span class="kw1">def</span> parse_wtime<span class="br0">&#40;</span>val<span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; vals = val.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot; &quot;</span>,<span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>.<span class="me1">split</span><span class="br0">&#40;</span><span class="st0">&quot;+&quot;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; res = <span class="kw3">datetime</span>.<span class="me1">timedelta</span><span class="br0">&#40;</span>0<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">for</span> ival <span class="kw1">in</span> vals:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="st0">&quot;-&quot;</span> <span class="kw1">in</span> ival:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; res += parse_hinterval<span class="br0">&#40;</span>ival<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; res += parse_hinterval<span class="br0">&#40;</span><span class="st0">&quot;00:00-%s&quot;</span> <span class="sy0">%</span> ival<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> res</p>
<p><span class="kw1">if</span> __name__==<span class="st0">&quot;__main__&quot;</span>:<br />
&nbsp; &nbsp; <span class="kw1">print</span> parse_wtime<span class="br0">&#40;</span><span class="st0">&quot;10:06-13:06 + 14:16-17:47 + 18:08-20:33&quot;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">print</span> parse_wtime<span class="br0">&#40;</span><span class="st0">&quot;9:47-13:08 + 14:08-19:00&quot;</span><span class="br0">&#41;</span></div>
</div>
<p>Che eseguito restituisce:</p>
<div class="codesnip-container" >
<div class="python codesnip" style="font-family:monospace;"><span class="sy0">&gt;&gt;&gt;</span> <br />
<span class="nu0">8</span>:<span class="nu0">56</span>:00<br />
<span class="nu0">8</span>:<span class="nu0">13</span>:00<br />
<span class="sy0">&gt;&gt;&gt;</span></div>
</div>
<p>Un po&#8217; di documentazione: <a href="http://www.python.org/doc/2.4.1/lib/datetime-timedelta.html">6.10.2 timedelta Objects</a>.
</p>
<ul class="socialwrap size24 row">
<li class="iconOnly"><a rel="nofollow" target="_blank" class="delicious" href="http://delicious.com/post?url=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Flavoro%2F&amp;title=Lavoro" title="Bookmark this post : Lavoro on Delicious"><span class="head">Bookmark on Delicious</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="digg" href="http://digg.com/submit?url=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Flavoro%2F&amp;title=Lavoro&amp;bodytext=Ho+cominciato+a+lavorare%21+Lavoro+per+la+%5BDeveler%5D%28http%3A%2F%2Fwww.develer.com%2F%29%2C+azienda+di+sviluppo+software+e+non+solo%2C+credo+di+aver+capito+specializzata+nel+non+specializzarsi.%0D%0A%0D%0ASono+stato+assegnato+ad+un+progetto+interno+un+po%27+noioso+che+consiste+nell%27adattare+%5BAchievo%5D%28http%3A%2F%2Fwww.achievo.org%2F%29+per+consentire+la+vis" title="Digg this post : Lavoro"><span class="head">Digg this post</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="facebook" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Flavoro%2F&amp;t=Lavoro" title="Recommend this post : Lavoro on Facebook"><span class="head">Recommend on Facebook</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="reddit" href="http://www.reddit.com/submit?url=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Flavoro%2F&amp;title=Lavoro" title="Share this post : Lavoro on Reddit"><span class="head">share via Reddit</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="stumble" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Flavoro%2F&amp;title=Lavoro" title="Share this post : Lavoro with Stumblers"><span class="head">Share with Stumblers</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="twitter" href="http://twitter.com/home/?status=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Flavoro%2F" title="Tweet this post : Lavoro on Twitter"><span class="head">Tweet about it</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="" class="rss" href="http://www.slug.it/naufraghi/lavoro/feed" title="Follow this post : Lavoro comments"><span class="head">Subscribe to the comments on this post</span></a></li>
</ul>
<div class="clean"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.slug.it/naufraghi/lavoro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Released PHP Math Publisher WordPress plugin</title>
		<link>http://www.slug.it/naufraghi/released-php-math-publisher-wordpress-plugin/</link>
		<comments>http://www.slug.it/naufraghi/released-php-math-publisher-wordpress-plugin/#comments</comments>
		<pubDate>Thu, 23 Mar 2006 11:45:39 +0000</pubDate>
		<dc:creator>Matteo</dc:creator>
				<category><![CDATA[informatica]]></category>
		<category><![CDATA[matematica]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.slug.it/naufraghi/php-math-publisher-wordpress-plugin/</guid>
		<description><![CDATA[This is a simple plugin for wordpress enabling the usage of the PHP Math Publisher lib: &#91;pmath&#93;&#40;a^2+b^2&#41;=a^2+2*a*b+b^2&#91;/pmath&#93; results in: Download it here PHP Math Publisher WordPress plugin. Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post]]></description>
			<content:encoded><![CDATA[<p>This is a simple plugin for wordpress enabling the usage of the <a href="http://www.xm1math.net/phpmathpublisher/">PHP Math Publisher</a> lib:</p>
<div class="codesnip-container" >
<div class="ini codesnip" style="font-family:monospace;"><span class="re0"><span class="br0">&#91;</span>pmath<span class="br0">&#93;</span><span class="br0">&#40;</span>a^<span class="nu0">2</span>+b^<span class="nu0">2</span><span class="br0">&#41;</span><span class="sy0">=</span>a^<span class="nu0">2</span>+<span class="nu0">2</span>*a*b+b^<span class="nu0">2</span><span class="br0">&#91;</span>/pmath<span class="br0">&#93;</span></span></div>
</div>
<p>results in:</p>
<p><img src="/naufraghi/wp-content/plugins/phpmathpublisher/img/math_986.5_ac4042336b720f070edf0ad49294ba38.png" style="vertical-align:-13.5px; display: inline-block ;" alt="(a^2+b^2)=a^2+2*a*b+b^2" title="(a^2+b^2)=a^2+2*a*b+b^2"/></p>
<p>Download it here <a href="http://www.slug.it/naufraghi/programmazione-web/php-math-publisher-wordpress-plugin/">PHP Math Publisher WordPress plugin</a>.</p>
<ul class="socialwrap size24 row">
<li class="iconOnly"><a rel="nofollow" target="_blank" class="delicious" href="http://delicious.com/post?url=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Freleased-php-math-publisher-wordpress-plugin%2F&amp;title=Released+PHP+Math+Publisher+WordPress+plugin" title="Bookmark this post : Released PHP Math Publisher WordPress plugin on Delicious"><span class="head">Bookmark on Delicious</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="digg" href="http://digg.com/submit?url=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Freleased-php-math-publisher-wordpress-plugin%2F&amp;title=Released+PHP+Math+Publisher+WordPress+plugin&amp;bodytext=This+is+a+simple+plugin+for+wordpress+enabling+the+usage+of+the+PHP+Math+Publisher+lib%3A%0D%0A%5Bpmath%5D%28a%5E2%2Bb%5E2%29%3Da%5E2%2B2%2Aa%2Ab%2Bb%5E2%5B%2Fpmath%5D%0D%0Aresults+in%3A%0D%0A%0D%0A%5Bpmath%5D%28a%5E2%2Bb%5E2%29%3Da%5E2%2B2%2Aa%2Ab%2Bb%5E2%5B%2Fpmath%5D%0D%0A%0D%0ADownload+it+here+PHP+Math+Publisher+WordPress+plugin." title="Digg this post : Released PHP Math Publisher WordPress plugin"><span class="head">Digg this post</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="facebook" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Freleased-php-math-publisher-wordpress-plugin%2F&amp;t=Released+PHP+Math+Publisher+WordPress+plugin" title="Recommend this post : Released PHP Math Publisher WordPress plugin on Facebook"><span class="head">Recommend on Facebook</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="reddit" href="http://www.reddit.com/submit?url=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Freleased-php-math-publisher-wordpress-plugin%2F&amp;title=Released+PHP+Math+Publisher+WordPress+plugin" title="Share this post : Released PHP Math Publisher WordPress plugin on Reddit"><span class="head">share via Reddit</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="stumble" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Freleased-php-math-publisher-wordpress-plugin%2F&amp;title=Released+PHP+Math+Publisher+WordPress+plugin" title="Share this post : Released PHP Math Publisher WordPress plugin with Stumblers"><span class="head">Share with Stumblers</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="twitter" href="http://twitter.com/home/?status=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Freleased-php-math-publisher-wordpress-plugin%2F" title="Tweet this post : Released PHP Math Publisher WordPress plugin on Twitter"><span class="head">Tweet about it</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="" class="rss" href="http://www.slug.it/naufraghi/released-php-math-publisher-wordpress-plugin/feed" title="Follow this post : Released PHP Math Publisher WordPress plugin comments"><span class="head">Subscribe to the comments on this post</span></a></li>
</ul>
<div class="clean"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.slug.it/naufraghi/released-php-math-publisher-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove curly quotes from WordPress 2.0 &lt;code&gt;</title>
		<link>http://www.slug.it/naufraghi/remove-curly-quotes-from-wordpress-20/</link>
		<comments>http://www.slug.it/naufraghi/remove-curly-quotes-from-wordpress-20/#comments</comments>
		<pubDate>Wed, 22 Mar 2006 01:26:00 +0000</pubDate>
		<dc:creator>Matteo</dc:creator>
				<category><![CDATA[informatica]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.slug.it/naufraghi/remove-curly-quotes-from-wordpress-20/</guid>
		<description><![CDATA[WordPress is a very good piece of software, so good that a problem can usually be solved in a few minutes. If you are a programmer you&#8217;l have noticed that a &#60;code&#62; tag containing some &#8230; code is sometime scrumbled by wordpress, converting the normal quotes in the culry ones. This conversion happends in the [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress is a very good piece of software, so good that a problem can usually be solved in a few minutes.</p>
<p>If you are a programmer you&#8217;l have noticed that a &lt;code&gt; tag containing some &#8230; code is sometime scrumbled by wordpress, converting the normal quotes in the  culry ones.</p>
<p>This conversion happends in the <samp>wp-includes / functions-formatting.php</samp> file, we can see the loop is skipping the block following &lt;code&gt;, &lt;pre&gt;, etc tags:</p>
<p>But this is not enough in the case we are using some code colorizer plugins as <a href="http://blog.enargi.com/codesnippet/">Code Snippet</a>.</p>
<p>But&#8230; with a few keystrokes we can count +1 when we enter in a &#8220;skippable&#8221; tag and count -1 when we found the closing tag.</p>
<p>The resulting code is working right now on the diff-file on the 2.0.2 version:</p>
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;">7c7<br />
<span class="sy0">&lt;</span> &nbsp; &nbsp; <span class="re0">$stop</span> <span class="sy0">=</span> <a href="http://www.php.net/count"><span class="kw3">count</span></a><span class="br0">&#40;</span><span class="re0">$textarr</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$next</span> <span class="sy0">=</span> <span class="kw4">true</span><span class="sy0">;</span> <span class="co1">// loop stuff</span><br />
<span class="sy0">&#8212;</span><br />
<span class="sy0">&gt;</span> &nbsp; &nbsp; <span class="re0">$stop</span> <span class="sy0">=</span> <a href="http://www.php.net/count"><span class="kw3">count</span></a><span class="br0">&#40;</span><span class="re0">$textarr</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$next</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> <span class="co1">// loop stuff</span><br />
11c11<br />
<span class="sy0">&lt;</span> &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$curl</span><span class="br0">&#123;</span><span class="nu0">0</span><span class="br0">&#125;</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <span class="st_h">&#8216;&lt;&#8217;</span> <span class="sy0">!=</span> <span class="re0">$curl</span><span class="br0">&#123;</span>0<span class="br0">&#125;</span> <span class="sy0">&amp;&amp;</span> <span class="re0">$next</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="co1">// If it&#8217;s not a tag</span><br />
<span class="sy0">&#8212;</span><br />
<span class="sy0">&gt;</span> &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$curl</span><span class="br0">&#123;</span><span class="nu0">0</span><span class="br0">&#125;</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <span class="st_h">&#8216;&lt;&#8217;</span> <span class="sy0">!=</span> <span class="re0">$curl</span><span class="br0">&#123;</span>0<span class="br0">&#125;</span> <span class="sy0">&amp;&amp;</span> <span class="re0">$next</span> <span class="sy0">==</span> <span class="nu0">0</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="co1">// If it&#8217;s not a tag</span><br />
40<span class="sy0">,</span>42c40<span class="sy0">,</span>42<br />
<span class="sy0">&lt;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$next</span> <span class="sy0">=</span> <span class="kw4">false</span><span class="sy0">;</span><br />
<span class="sy0">&lt;</span> &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
<span class="sy0">&lt;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$next</span> <span class="sy0">=</span> <span class="kw4">true</span><span class="sy0">;</span><br />
<span class="sy0">&#8212;</span><br />
<span class="sy0">&gt;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$next</span> <span class="sy0">+=</span> <span class="nu0">1</span><span class="sy0">;</span><br />
<span class="sy0">&gt;</span> &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">elseif</span> <span class="br0">&#40;</span><a href="http://www.php.net/strstr"><span class="kw3">strstr</span></a><span class="br0">&#40;</span><span class="re0">$curl</span><span class="sy0">,</span> <span class="st_h">&#8216;&lt;/code&#8217;</span><span class="br0">&#41;</span> <span class="sy0">||</span> <a href="http://www.php.net/strstr"><span class="kw3">strstr</span></a><span class="br0">&#40;</span><span class="re0">$curl</span><span class="sy0">,</span> <span class="st_h">&#8216;&lt;/pre&#8217;</span><span class="br0">&#41;</span> <span class="sy0">||</span> <a href="http://www.php.net/strstr"><span class="kw3">strstr</span></a><span class="br0">&#40;</span><span class="re0">$curl</span><span class="sy0">,</span> <span class="st_h">&#8216;&lt;/kbd&#8217;</span> <span class="sy0">||</span> <a href="http://www.php.net/strstr"><span class="kw3">strstr</span></a><span class="br0">&#40;</span><span class="re0">$curl</span><span class="sy0">,</span> <span class="st_h">&#8216;&lt;/style&#8217;</span><span class="br0">&#41;</span> <span class="sy0">||</span> <a href="http://www.php.net/strstr"><span class="kw3">strstr</span></a><span class="br0">&#40;</span><span class="re0">$curl</span><span class="sy0">,</span> <span class="st_h">&#8216;&lt;/script&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="sy0">&gt;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$next</span> <span class="sy0">-=</span> <span class="nu0">1</span><span class="sy0">;</span></div>
</div>
<p>Thanks to <a href="http://www.moskalyuk.com/blog/removing-curly-quotes-from-wordpress-20/996">www.moskalyuk.com</a> for the idea and to the <a href="http://www.wordpress.org">wordpress</a> team for &#8230; wordpress!</p>
<p>Due righe in italiano per chi proprio l&#8217;inglese non lo mastica.</p>
<p>WordPress converte virgolette e apostrofi semplici in curvi, e questo può essere un problema quando si vuole inserire del codice nella pagina. Infatti la versione attuale della funzione che fa il lavoro di &#8220;abbellimento&#8221; delle virgolette evita il contenuto di alcuni tag, come &lt;code&gt; e &lt;pre&gt;, ma non riesce a gestire i casi un po&#8217; più complessi, come i codici colorati da <a href="http://blog.enargi.com/codesnippet/">Code Snippet</a> ad esempio.</p>
<p>Qua sopra una patch che invece di saltare solo il primo &#8220;blocco&#8221; dopo un tag critico, salta fino a quando non incontra un tag critico chiuso. Se il codice è bilanciato e corretto&#8230; funziona, se il codice non è corretto&#8230; poco male, perderemo le belle virgolette.</p>
<ul class="socialwrap size24 row">
<li class="iconOnly"><a rel="nofollow" target="_blank" class="delicious" href="http://delicious.com/post?url=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Fremove-curly-quotes-from-wordpress-20%2F&amp;title=Remove+curly+quotes+from+WordPress+2.0+%26lt%3Bcode%26gt%3B" title="Bookmark this post : Remove curly quotes from WordPress 2.0 &lt;code&gt; on Delicious"><span class="head">Bookmark on Delicious</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="digg" href="http://digg.com/submit?url=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Fremove-curly-quotes-from-wordpress-20%2F&amp;title=Remove+curly+quotes+from+WordPress+2.0+%26lt%3Bcode%26gt%3B&amp;bodytext=Wordpress+is+a+very+good+piece+of+software%2C+so+good+that+a+problem+can+usually+be+solved+in+a+few+minutes.%0D%0A%0D%0AIf+you+are+a+programmer+you%27l+have+noticed+that+a+%26lt%3Bcode%26gt%3B+tag+containing+some+...+code+is+sometime+scrumbled+by+wordpress%2C+converting+the+normal+quotes+in+the++culry+ones.%0D%0A%0D%0AThis+conversion+happends+in+th" title="Digg this post : Remove curly quotes from WordPress 2.0 &lt;code&gt;"><span class="head">Digg this post</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="facebook" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Fremove-curly-quotes-from-wordpress-20%2F&amp;t=Remove+curly+quotes+from+WordPress+2.0+%26lt%3Bcode%26gt%3B" title="Recommend this post : Remove curly quotes from WordPress 2.0 &lt;code&gt; on Facebook"><span class="head">Recommend on Facebook</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="reddit" href="http://www.reddit.com/submit?url=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Fremove-curly-quotes-from-wordpress-20%2F&amp;title=Remove+curly+quotes+from+WordPress+2.0+%26lt%3Bcode%26gt%3B" title="Share this post : Remove curly quotes from WordPress 2.0 &lt;code&gt; on Reddit"><span class="head">share via Reddit</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="stumble" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Fremove-curly-quotes-from-wordpress-20%2F&amp;title=Remove+curly+quotes+from+WordPress+2.0+%26lt%3Bcode%26gt%3B" title="Share this post : Remove curly quotes from WordPress 2.0 &lt;code&gt; with Stumblers"><span class="head">Share with Stumblers</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="twitter" href="http://twitter.com/home/?status=http%3A%2F%2Fwww.slug.it%2Fnaufraghi%2Fremove-curly-quotes-from-wordpress-20%2F" title="Tweet this post : Remove curly quotes from WordPress 2.0 &lt;code&gt; on Twitter"><span class="head">Tweet about it</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="" class="rss" href="http://www.slug.it/naufraghi/remove-curly-quotes-from-wordpress-20/feed" title="Follow this post : Remove curly quotes from WordPress 2.0 &lt;code&gt; comments"><span class="head">Subscribe to the comments on this post</span></a></li>
</ul>
<div class="clean"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.slug.it/naufraghi/remove-curly-quotes-from-wordpress-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
