<?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>tinowagner.com // Blog &#187; Wiki</title>
	<atom:link href="http://blog.tinowagner.com/tag/wiki/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tinowagner.com</link>
	<description>Dies und das.</description>
	<lastBuildDate>Wed, 25 Nov 2009 00:44:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wikispam</title>
		<link>http://blog.tinowagner.com/2005/01/01/wikispam/</link>
		<comments>http://blog.tinowagner.com/2005/01/01/wikispam/#comments</comments>
		<pubDate>Sat, 01 Jan 2005 19:19:45 +0000</pubDate>
		<dc:creator>Tino Wagner</dc:creator>
				<category><![CDATA[Web-Dev]]></category>
		<category><![CDATA[Spam]]></category>
		<category><![CDATA[Webdesign]]></category>
		<category><![CDATA[Wiki]]></category>

		<guid isPermaLink="false">http://tinowagner.comentwicklung/wikispam/</guid>
		<description><![CDATA[Im Lamppix-Wiki meinen immer wieder findige Unternehmer, ihre Internetadressen hinterlassen zu m&#252;ssen. Das verbessert nat&#252;rlich deren Google-Ranking, sie werden bekannt und bekommen mehr Besuch.
So glaubt man, funktioniert die Branche.
Dieser Spam im Wiki ging mir aber langsam und sicher so sehr auf den Senkel, da&#223; ich etwas dagegen tun mu&#223;te. Hier ist also der ultimative Blacklist-Hack [...]]]></description>
			<content:encoded><![CDATA[<p>Im <a href="http://lamppix.tinowagner.com/wiki/">Lamppix-Wiki</a> meinen immer wieder findige Unternehmer, ihre Internetadressen hinterlassen zu m&#252;ssen. Das verbessert nat&#252;rlich deren Google-Ranking, sie werden bekannt und bekommen mehr Besuch.</p>
<p>So glaubt man, funktioniert die Branche.</p>
<p>Dieser Spam im Wiki ging mir aber langsam und sicher so sehr auf den Senkel, da&#223; ich etwas dagegen tun mu&#223;te. Hier ist also der ultimative Blacklist-Hack f&#252;r <a href="http://phpwiki.sf.net/">PhpWiki</a></p>
<p><span id="more-17"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?
<span style="color: #666666; font-style: italic;">// blacklist hack, tino wagner, 2005-01-01</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span>blacklistFile<span style="color: #339933;">,</span> <span style="color: #0000ff;">'black.list'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> blacklistCheck<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$lines</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file</span><span style="color: #009900;">&#40;</span>blacklistFile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$lines</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">stristr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Diese Funktion in eine neue Datei &bdquo;lib/blacklist.php&ldquo; speichern. (&bdquo;lib&ldquo; ist ein Unterverzeichnis von PhpWiki)</p>
<p>In der Datei index.php von PhpWiki gibt es die Stelle <em>include &bdquo;lib/stdlib.php&ldquo;;</em>. Gleich darunter sollte diese Zeile eingetragen werden:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include</span> <span style="color: #0000ff;">&quot;lib/blacklist.php&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Letzter Schritt: Die Blacklist endg&#252;ltig aktivieren.<br />
Dazu &bdquo;lib/savepage.php&ldquo; &#246;ffnen und diese Stelle suchen:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// set new pageinfo</span>
<span style="color: #000088;">$pagehash</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'lastmodified'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pagehash</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'version'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span>
<span style="color: #000088;">$pagehash</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'author'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$remoteuser</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Dar&#252;ber</strong> folgende Zeilen eintragen:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// check if the new page contains blacklisted strings</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$blacklistedWord</span> <span style="color: #339933;">=</span> blacklistCheck<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	GeneratePage<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'MESSAGE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;p&gt;I'm sorry, but &quot;</span><span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;your content contained blacklisted URLs, words &quot;</span><span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;or whatever.&lt;/p&gt;&lt;p&gt;Check for &lt;b&gt;&lt;i&gt;&quot;</span><span style="color: #339933;">.</span>
		<span style="color: #000088;">$blacklistedWord</span><span style="color: #339933;">.</span>
		<span style="color: #0000ff;">&quot;&lt;/i&gt;&lt;/b&gt; to correct this.&lt;/p&gt;&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">gettext</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Problem while updating <span style="color: #009933; font-weight: bold;">%s</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		<span style="color: #000088;">$pagename</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		<span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Jetzt fehlt blo&#223; noch die Blacklist selbst. Eine Datei mit dem Namen &bdquo;black.list&ldquo; im selben Verzeichnis wie index.php erstellen und dort alle URLs oder W&#246;rter eintragen (eine Zeile &#8212; ein Eintrag), nach denen gesucht werden soll.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tinowagner.com/2005/01/01/wikispam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
