function encodeLinks($text) { #~Bas Find and properly encode all links. preg_match_all("/<a(.*)href=[\"\\'](.*)[\"\\']([^>]*)>/Umis", $text, $links); foreach ($links[0] as $matchindex => $fullmatch) { $linkurl = $links[2][$matchindex]; $linkreplace = '<a' . $links[1][$matchindex] . ' href="' . linkencode($linkurl) . '"' . $links[3][$matchindex] . '>'; $text = str_replace($fullmatch, $linkreplace, $text); } return $text; }
function get_html() { album_content::get_html(); return "<embed src=" . linkencode($this->get_file()) . "></embed"; }
public function verify_file() { check_admin_referer('wp_ajax_shopp_verify_file'); $Settings =& ShoppSettings(); chdir(WP_CONTENT_DIR); // relative file system path context for realpath $url = $_POST['url']; $request = parse_url($url); if ($request['scheme'] == "http") { $results = get_headers(linkencode($url)); if (substr($url, -1) == "/") { die("ISDIR"); } if (strpos($results[0], '200') === false) { die("NULL"); } } else { $url = str_replace('file://', '', $url); if ($url[0] != "/" || substr($url, 0, 2) == "./" || substr($url, 0, 3) == "../") { $result = apply_filters('shopp_verify_stored_file', $url); } $url = sanitize_path(realpath($url)); if (!file_exists($url)) { die('NULL'); } if (is_dir($url)) { die('ISDIR'); } if (!is_readable($url)) { die('READ'); } } die('OK'); }
} else { echo $html; } } else { // open failed include("includes/404.php"); } include("includes/browse_footer.php"); } else if( $searchstring != "" ) { // the user is searching $all = $HTTP_POST_VARS["all"]; $cat = $HTTP_POST_VARS["cat"]; include("includes/search_header.php"); if($show_search_sponsor != "" ) include("includes/" . $sponsor_file_search); $searchurl = linkencode($searchurl . $searchstring . "&all=$all&cat=$cat" . ($start == "" ? "" : "&start=" . $start ) . ($morecat == "" ? "" : "&morecat=" . $morecat)); $html = readData( $searchurl, $search_cache ); if( strpos( $html, $noresult) != FALSE ) { // no results found include("includes/search_no_result.php"); } else { $startpos = strpos( $html, $startsrch ); $html = substr( $html, $startpos, strlen($html)); $endpos = strpos( $html, $endsrch ); $html = substr( $html, 0, $endpos ); $html = str_replace( $linkstr . "/", $linkstr . $replace . "/", $html ); $html = str_replace( "http://dmoz.org", "$filename?browse=", $html ); $html = str_replace( $search_next, $search_next_replace, $html );