<?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>Danik.info &#187; wp</title>
	<atom:link href="http://danik.info/tag/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://danik.info</link>
	<description>useful notes for admins</description>
	<lastBuildDate>Fri, 18 May 2012 11:46:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>0Day Vulnerability in WordPress themes</title>
		<link>http://danik.info/vulnerability_in_wordpress/</link>
		<comments>http://danik.info/vulnerability_in_wordpress/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 07:02:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Advices for webmasters]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[fuckup]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[vulnerability]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://danik.info/?p=3050</guid>
		<description><![CDATA[Included in many wordpress themes utility for image resizing timthumb.php, is vulnerable to arbitrary loading PHP-code. In it’s config script has several domains from witch it is allowed to upload images: flickr.com picasa.com blogger.com wordpress.com img.youtube.com upload.wikimedia.org photobucket.com Because of lack of validation, it is possible to load a phpshell to the target wordpress blog. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://danik.info/wp-content/uploads/2011/08/wphack.jpg"><img class="aligncenter size-full wp-image-3051" title="wphack" src="http://danik.info/wp-content/uploads/2011/08/wphack.jpg" alt="wphack 0Day Vulnerability in WordPress themes" width="276" height="182" /></a></p>
<p>Included in many wordpress themes utility for image resizing timthumb.php, is vulnerable to arbitrary loading PHP-code.</p>
<p><span id="more-3050"></span></p>
<p>In it’s config script has several domains from witch it is allowed to upload images:</p>
<ul>
<li>flickr.com</li>
<li>picasa.com</li>
<li>blogger.com</li>
<li>wordpress.com</li>
<li>img.youtube.com</li>
<li>upload.wikimedia.org</li>
<li>photobucket.com</li>
</ul>
<p>Because of lack of validation, it is possible to load a phpshell to the target wordpress blog. Other words timthumb.php utility finds link blogger.com.hackersite.com / webshell.php legitimate and allows you to load a script to the server.<br />
Vulnerability found Mark Maunder , after his blog was hacked.<br />
p.s. you can download patched version from here <a href="http://code.google.com/p/timthumb/source/browse/trunk/timthumb.php">patched timthumb.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://danik.info/vulnerability_in_wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Исключение рубрик с главной страницы</title>
		<link>http://danik.info/isklyuchenie-rubrik-s-glavnoj-stranicy/</link>
		<comments>http://danik.info/isklyuchenie-rubrik-s-glavnoj-stranicy/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 10:24:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Advices]]></category>
		<category><![CDATA[Advices for webmasters]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[новости]]></category>

		<guid isPermaLink="false">http://danik.info/isklyuchenie-rubrik-s-glavnoj-stranicy/</guid>
		<description><![CDATA[Способов исключения показа записей определенной рубрики на главной странице блога несколько. Больше всего мне нравится метод с добавлением своего фильтра в файл functions.php, так как это избавляет от необходимости править другие файлы шаблона, а в частности не надо возиться с переделкой цикла вывода записей в index.php через query_posts.&#160; Рассмотрим самый простой пример: удаляем записи рубрики [...]]]></description>
			<content:encoded><![CDATA[<p><img style="display: block; float: none; margin-left: auto; margin-right: auto" title="How-to-Make-a-Cool-WordPres" alt="HowtoMakeaCoolWordPres thumb Исключение рубрик с главной страницы" src="http://danik.info/wp-content/uploads/2009/11/HowtoMakeaCoolWordPres_thumb.png" width="640" height="282" />Способов исключения показа записей определенной рубрики на главной странице блога несколько. Больше всего мне нравится метод с добавлением своего фильтра в файл <strong>functions.php</strong>, так как это избавляет от необходимости править другие файлы шаблона, а в частности не надо возиться с переделкой цикла вывода записей в <strong>index.php</strong> через <strong>query_posts</strong>.&#160; </p>
<p> <span id="more-674"></span>
<p>Рассмотрим самый простой пример: удаляем записи рубрики с <strong>ID=5</strong> с главной страницы, для этого добавим в файл <strong>functions.php</strong> код:</p>
<pre>function removeFromHome($query) {
if ($query-&gt;is_home)
	{$query-&gt;set('cat','-5');}
return $query; }
add_filter('pre_get_posts','removeFromHome');</pre>
<p>Теперь на главной странице не будут присутствовать записи из рубрики с <strong>ID 5</strong>. Хочу напомнить, что в понимании <strong>WordPress</strong> главной страницей считается также и любая другая страница, образованная постраничной навигацией. То есть посты из рубрики <strong>5</strong> вы не увидите и на <strong>/page/2</strong>, <strong>/page/3</strong> и др. Если вас это не устраивает, то вы должны слегка модифицировать приведенный код.</p>
<pre>function removeFromHome($query) {
if ($query-&gt;is_home &amp;&amp; !(is_paged()))
	{$query-&gt;set('cat','-5');}
return $query; }
add_filter('pre_get_posts','removeFromHome');</pre>
<p>Теперь и на странице <strong>/page/2</strong> и на следующих страницах записи рубрики с <strong>ID 5</strong> будут показываться. Аналогичным способом можно исключить показ записей рубрики не только с главной страницы. Например, для исключения записей рубрики из страницы результатов поиска вам надо поменять <strong>is_home</strong> на<strong>is_search</strong>. Для исключения нескольких рубрик перечислите их <strong>ID</strong> через запятую, то есть <strong>&#8216;-5,-6,-7&#8242;</strong> и т.д.</p>
<p>Что если нам не надо исключать записи рубрик из блога, но надо исключить их из <strong>RSS</strong> ленты? Используем тот же самый код:</p>
<pre>function removeFromFeed($query) {
if ($query-&gt;is_feed)
	{$query-&gt;set('cat','-5');}
return $query; }
add_filter('pre_get_posts','removeFromFeed');</pre>
<p>И вашей ленте не будут присутствовать записи из указанной рубрики. Если надо совместить удаление записей рубрики и из главной страницы и из фида используйте что-то типа:</p>
<pre>function removeCat($query) {
if ($query-&gt;is_feed || ($query-&gt;is_home &amp;&amp; !(is_paged())))
	{$query-&gt;set('cat','-5,-34');}
return $query; }
add_filter('pre_get_posts','removeCat');</pre>
<p>Данный код удалит записи рубрик с <strong>ID 5</strong> и <strong>34</strong> и из <strong>RSS</strong> ленты и из главной страницы блога, но будет их показывать, если главная страница сменилась на<strong>/page/2</strong> и следующие, образованные постраничной навигацией.</p>
<p>&#160;</p>
<p>если вы используете вывод последних постов в сайдбаре, то вам надо заменить код:</p>
<pre>&lt;?php get_archives('postbypost', 5); ?&gt;</pre>
<p>на что-то типа:</p>
<pre>&lt;?php $recent = new WP_Query(&quot;showposts=5&quot;); while($recent-&gt;have_posts()) : $recent-&gt;the_post();?&gt;
&lt;li&gt;&lt;a href='&lt;?php the_permalink(); ? rel=&quot;nofollow&quot;&gt;' title='&lt;?php the_title(); ?&gt;'&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
&lt;?php endwhile; ?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://danik.info/isklyuchenie-rubrik-s-glavnoj-stranicy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

