From: Brion Vibber Date: Mon, 23 Jun 2003 07:01:42 +0000 (+0000) Subject: Add wfFullUrl()/wfFullUrlE() function to explicitly include the http://foo.bar/ to... X-Git-Tag: 1.1.0~487 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=7303e8e6675cfcca31a23e4f04e69d7e1b43ffd9;p=lhc%2Fweb%2Fwiklou.git Add wfFullUrl()/wfFullUrlE() function to explicitly include the foo.bar/ to use in links we give out to the world --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 394a227f55..5dc0e23ace 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -64,6 +64,15 @@ function wfLocalUrlE( $a, $q = "" ) return wfEscapeHTML( wfLocalUrl( $a, $q ) ); } +function wfFullUrl( $a, $q = "" ) { + global $wgServer; + return $wgServer . "/" . wfLocalUrl( $a, $q ); +} + +function wfFullUrlE( $a, $q = "" ) { + return wfEscapeHTML( wfFullUrl( $a, $q ) ); +} + function wfImageUrl( $img ) { global $wgUploadPath; diff --git a/rdf/recent.phtml b/rdf/recent.phtml index de8d1a300a..f96ad2c647 100644 --- a/rdf/recent.phtml +++ b/rdf/recent.phtml @@ -53,7 +53,7 @@ while( $row = wfFetchObject( $res ) ) { $title = htmlspecialchars( iconv($wgInputEncoding, "utf-8", str_replace( "_", " ", $row->cur_title ) ) ); - $url = wfLocalUrl( wfUrlencode( $row->cur_title ) ); + $url = wfFullUrl( wfUrlencode( $row->cur_title ) ); $description = "" . iconv($wgInputEncoding, "utf-8", htmlspecialchars( $row->cur_comment )) . ""; echo "