From 7303e8e6675cfcca31a23e4f04e69d7e1b43ffd9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 23 Jun 2003 07:01:42 +0000 Subject: [PATCH] Add wfFullUrl()/wfFullUrlE() function to explicitly include the http://foo.bar/ to use in links we give out to the world --- includes/GlobalFunctions.php | 9 +++++++++ rdf/recent.phtml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) 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 " -- 2.20.1