From: short <> Date: Thu, 25 Apr 2002 16:18:41 +0000 (+0000) Subject: Implemented $have_ent detection (enabled by $detect_ent, default) X-Git-Url: https://git.jankratochvil.net/?p=www.energie.vellum.cz.git;a=commitdiff_plain;h=83149e59cb1ac3f57b155e99878a6f44a6bfd187 Implemented $have_ent detection (enabled by $detect_ent, default) - specifies the ability to decode entities in tag attributes -function addpercents() - calls replaced by standard urlencode() Fixed missing "title" attribute in footer_img() - function not used now +function a_href($url,$contents) w3.org footer images are now stored as local w3.org footer referenced by $have_ent-detected optional redirect.php --- diff --git a/common.php b/common.php index 240ad20..4acad91 100644 --- a/common.php +++ b/common.php @@ -2,7 +2,6 @@ error_reporting(E_ALL); setlocale(LC_ALL,"cs_CZ.iso-8859-2"); - fixampvars(); include("config.php"); @@ -16,6 +15,22 @@ } $cvs_id_html=join(" ",$cvs_id_split); + if (!isset($head)) + $head=""; + + unset($have_ent); + if (isset($HTTP_GET_VARS[ "have_ent"])) + $have_ent=true; + if (isset($HTTP_GET_VARS["amp;have_ent"])) + $have_ent=false; + if ((!isset($detect_ent) || $detect_ent) && !isset($have_ent) && $HTTP_SERVER_VARS["REQUEST_METHOD"]=="GET") + $head.=''."\n"; + fixampvars(); + $have_js=(isset($HTTP_GET_VARS["have_js"]) || isset($HTTP_POST_VARS["have_js"]) ? "?have_js=1" : ""); if (isset($detect_js) && !$have_js) @@ -43,17 +58,6 @@ function fixampvars() } } -function addpercents($url) -{ - $r=$c=""; - foreach(preg_split('//', $url, -1, PREG_SPLIT_NO_EMPTY) as $c) - if (ereg("[a-zA-Z0-9]",$c)) - $r.=$c; - else - $r.=sprintf("%%%02X",ord($c)); - return($r); -} - function fatal($msg="UNKNOWN") { global $admin_mail; @@ -615,11 +619,21 @@ function footer_img($url,$text,$size) { global $footer_LOCAL; if (!isset($footer_LOCAL)) - return("\"$text\""); + return("\"$text\""); else return($text); } +function a_href($url,$contents) +{ + global $have_ent; + + print("$contents"); +} + function footer($delimit=true) { // deadlock prevention: @@ -631,18 +645,18 @@ function footer($delimit=true) global $cvs_id_html,$viewcvs,$viewcvs,$HTTP_SERVER_VARS; if ($delimit) print("

 

\n"); - $uri="uri=".addpercents("http://".$HTTP_SERVER_VARS["HTTP_HOST"].$HTTP_SERVER_VARS["REQUEST_URI"]); + $uri="uri=".urlencode("http://".$HTTP_SERVER_VARS["HTTP_HOST"].$HTTP_SERVER_VARS["REQUEST_URI"]); ?>
- +