Changeset 993828
- Timestamp:
- 09/20/2014 11:22:23 AM (12 years ago)
- Location:
- http-syndication/trunk
- Files:
-
- 2 edited
-
http_syndication.php (modified) (2 diffs)
-
wrap.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
http-syndication/trunk/http_syndication.php
r993824 r993828 30 30 } 31 31 32 // Captures the http request if corresponding to a http_syndication and output the related content33 32 function http_syndication_request($request) { 34 33 if (isset($_REQUEST['httpsyndication']) && (isset($request['p']) || isset($request['page_id']))) { 34 // Captures the http request if corresponding to a http_syndication and output the related content 35 35 $id = isset($request['p']) ? $request['p'] : $request['page_id']; 36 36 $post = get_post($id); 37 37 $content = str_replace(']]>', ']]>', apply_filters('the_content', $post->post_content)); 38 38 echo "<h1>".$post->post_title."</h1>\n".$content; 39 exit(0); 40 } else if (isset($_REQUEST['httpsyndicationwrap'])) { 41 include_once plugin_dir_path( __FILE__ ).'/wrap.php'; 39 42 exit(0); 40 43 } else … … 52 55 $style = urlencode(isset($atts['style']) ? $atts['style'] : "border: none;"); 53 56 $newtab = (isset($atts['newtab']) && $atts['newtab'] == 1) ? " target='_blank'" : ""; 54 return "<a href='".site_url()." /wp-content/plugins/http_syndication/wrap.php?banner=$banner&url=$url&height=$height&style=$style'$newtab>$content</a>";57 return "<a href='".site_url()."?httpsyndicationwrap&banner=$banner&url=$url&height=$height&style=$style'$newtab>$content</a>"; 55 58 } else 56 59 return "[import error='a `banner` is specified but without any external `url`, thus nothing to import']"; -
http-syndication/trunk/wrap.php
r993824 r993828 1 1 <?php 2 // Loads the WP PHP functions3 require_once("../../../wp-load.php");4 // Protects the page from spurious access5 if ((!isset($_SERVER['HTTP_REFERER'])) || $_SERVER['HTTP_REFERER'] == "" || strncmp($_SERVER['HTTP_REFERER'], site_url(), strlen(site_url())) != 0) {6 echo "Sorry ".$_SERVER['HTTP_REFERER'].", not allowed to acces this page<hr>\n";7 exit(-1);8 }9 2 // Gets the used parameters 10 3 $banner = $_REQUEST['banner'];
Note: See TracChangeset
for help on using the changeset viewer.