<?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>Anchor Web Hosting Blog &#187; text</title>
	<atom:link href="http://www.anchor.com.au/blog/tag/text/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anchor.com.au/blog</link>
	<description>A view into the Anchor Engineroom</description>
	<lastBuildDate>Wed, 08 Feb 2012 00:51:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A fix for the browser crashing blues</title>
		<link>http://www.anchor.com.au/blog/2008/12/a-fix-for-the-browser-crashing-blues/</link>
		<comments>http://www.anchor.com.au/blog/2008/12/a-fix-for-the-browser-crashing-blues/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 01:08:04 +0000</pubDate>
		<dc:creator>oliver</dc:creator>
				<category><![CDATA[FTW]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[editing]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[it'salltext]]></category>
		<category><![CDATA[mozex]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=178</guid>
		<description><![CDATA[Ever been constructing a verbose and complex reply to an email on a webmail site, only to have the browser crash when you were about to hit send? Or perhaps putting the finishing touches on your Wikipedia edits to the particle physics article (I know I have) and have all of your hard work lost [...]]]></description>
			<content:encoded><![CDATA[<p>Ever been constructing a verbose and complex reply to an email on a webmail site, only to have the browser crash when you were about to hit send? Or perhaps putting the finishing touches on your Wikipedia edits to the particle physics article (I know I have) and have all of your hard work lost in the blink of eye?</p>
<p>Fear not, salvation is at hand! Although many Web 2.0 sites providing text-editing will save drafts and provide a reasonable text editor, nothing beats your favourite text editor of all time, Vim. Or Emacs. Or whatever you would prefer to use. Why shouldn&#8217;t you be able to use any text editor you like? It&#8217;s your computer and your time after all!</p>
<p>If you are using Firefox, your problems are over. Introducing <a href="https://addons.mozilla.org/en-US/firefox/addon/4125">It&#8217;s All Text</a>. Install this handy plug-in to your Firefox, set the default editor to your liking and you are off and running! Now any text box on any webpage will show a small <strong>edit</strong> button on the bottom right corner allowing you to launch the editor of your choice. Edit to your heart&#8217;s content using the tools you are most familiar with, then save and exit the editor and have all your work sent back to the browser text box.</p>
<p>Even if the browser crashes mid-edit, your editor program will be unaffected and your work will be safe. You can save your work in the editor in addition to any swap or draft files it creates for even more safeguards.</p>
<p>It&#8217;sAllText works in Firefox 3.0. If you have older versions of Firefox you may wish to check out <a href="https://addons.mozilla.org/en-US/firefox/addon/40">MozEX</a> which is a similar plug-in.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2008/12/a-fix-for-the-browser-crashing-blues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bug report: &#8220;all&#8221; does not mean all, for some values of &#8220;all&#8221;</title>
		<link>http://www.anchor.com.au/blog/2008/11/bug-report-all-does-not-mean-all-for-some-values-of-all/</link>
		<comments>http://www.anchor.com.au/blog/2008/11/bug-report-all-does-not-mean-all-for-some-values-of-all/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 01:11:35 +0000</pubDate>
		<dc:creator>Barney Desmond</dc:creator>
				<category><![CDATA[WTF]]></category>
		<category><![CDATA[all files]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=54</guid>
		<description><![CDATA[We&#8217;ve discovered some interesting things about Windows, and they never fail to cause some head-scratching. We had cause to go rooting through a customer&#8217;s wordpress installation recently to hunt down the cause of PHP errors, and discovered two WTFs here. The first was the breakage of various scripts in the wp-admin directory. Through means unknown, [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve discovered some interesting things about Windows, and they never fail to cause some head-scratching. We had cause to go rooting through a customer&#8217;s wordpress installation recently to hunt down the cause of PHP errors, and discovered two WTFs here.</p>
<p>The first was the breakage of various scripts in the wp-admin directory. Through means unknown, every array definition was broken by the addition of a file path. If you grok PHP, you&#8217;ll recognise that this isn&#8217;t syntactically valid:</p>
<blockquote>
<pre><span style="#999999;"><span style="#999999;"><span style="#999999;"><span style="#339966;"><span style="#339966;"><span style="#339966;">$defaults</span></span></span> <span style="#999999;">=</span> <span style="#999999;"><span style="#0000ff;"><span style="#0000ff;"><span style="#0000ff;">array</span></span></span>(</span></span></span></span></pre>
<pre><span style="#999999;"><span style="#999999;"><span style="#999999;"><span style="#999999;"><span style="#000000;"><span style="#ff0000;"><span style="#ff0000;"><span style="#ff0000;">'show_option_all'</span></span></span>../../../<span style="#000000;"><span style="#000000;"><span style="#000000;">wordpress</span></span></span>/<span style="#000000;"><span style="#000000;"><span style="#000000;">wp-includes</span></span></span>/ =&gt; <span style="#ff0000;"><span style="#ff0000;"><span style="#ff0000;">''</span></span></span>,
<span style="#ff0000;"><span style="#ff0000;"><span>'show_option_none'</span></span></span>../../../<span style="#000000;"><span style="#000000;"><span style="#000000;">wordpress</span></span></span>/<span style="#000000;"><span style="#000000;"><span style="#000000;">wp-includes</span></span></span>/ =&gt; <span style="#ff0000;"><span style="#ff0000;"><span style="#ff0000;">''</span></span></span></span></span></span></span></span></pre>
<pre><span style="#999999;"><span style="#999999;"><span style="#999999;"><span style="#999999;">);</span></span></span></span></pre>
</blockquote>
<p>Python is our preferred in-house language, but breadth of knowledge is more important for a sysadmin. Cleaning up the PHP was a snap, but it&#8217;s a mystery as to how this happened in the first place; according to the customer it &#8220;just stopped working&#8221;. It looks a bit like someone got busy with a site-wide find-and-replace. This isn&#8217;t implausible, but it seems far less likely given that this is on a Windows machine.</p>
<p><span id="more-54"></span></p>
<p>Speaking of find and replace, just the finding dodgy strings proved to be more difficult than expected. Given that it was one customer&#8217;s site that was affected, it should be easy to search for all occurrences of <span style="#999999;"><span style="#999999;"><span style="#999999;"><span style="#000000;"><span style="#339966;"><span style="#ff0000;">../../../<span style="#000000;"><span style="#000000;">wordpress</span></span>/<span style="#000000;"><span style="#000000;">wp-includes</span></span>/</span></span> and be done with it.</span></span></span></span></p>
<p>Certainly under linux you&#8217;d use grep, put it in recursive mode and ask it to list the relevant files.</p>
<pre>grep -r -l '<span style="#999999;"><span style="#999999;"><span style="#999999;"><span style="#000000;">../../../<span style="#000000;"><span style="#000000;">wordpress</span></span>/<span style="#000000;"><span style="#000000;">wp-includes</span></span>/' /path/to/customers/site
</span></span></span></span></pre>
<p>Under Windows you&#8217;d use the usual file-search tool. Leave the filename field blank so we don&#8217;t limit it, then put the search string in the box below. Just to be really sure, we&#8217;ll open the Advanced Options and select &#8220;All Files and Folders&#8221;. Root the search at the customer&#8217;s site and fire it up, this is exactly what we need. Except that Windows won&#8217;t find the string in your PHP files.</p>
<p>As you may have guessed, this is when &#8220;all files&#8221; doesn&#8217;t actually mean all files. It even seems this is a known issue, and there&#8217;s a &#8220;fix&#8221; noted by someone else. The long and the short of it is that PHP files aren&#8217;t &#8220;recognised&#8221; by Windows, so it won&#8217;t try to search them; the latter page describes what you have to do to work around it.</p>
<p><a href="http://support.microsoft.com/?kbid=309173">http://support.microsoft.com/?kbid=309173</a></p>
<p><a href="http://cow.neondragon.net/index.php/72-Searching-Php-Files-With-Windows-Search">http://cow.neondragon.net/index.php/72-Searching-Php-Files-With-Windows-Search</a></p>
<p>In fairness, there&#8217;s a certain amount of logic to it. You probably don&#8217;t want to be searching for text in binary files like DLLs or video clips. That said, it badly breaks the expected behaviour of the search tool. If you&#8217;re searching for text in all files, it should (to our mind) be understood that you&#8217;re literally searching in <em>every</em> file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2008/11/bug-report-all-does-not-mean-all-for-some-values-of-all/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

