diff --git a/README.md b/README.md index caa00a4..9f42463 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ $rss->descriptionTruncSize = 500; $rss->descriptionHtmlSyndicated = true; $rss->link = "http://www.dailyphp.net/news"; -$rss->syndicationURL = "http://www.dailyphp.net/" . $_SERVER["PHP_SELF"]; +$rss->syndicationURL = "http://www.dailyphp.net/" . $_SERVER["SCRIPT_NAME"]; $image = new FeedImage(); $image->title = "dailyphp.net logo"; diff --git a/lib/Creator/FeedCreator.php b/lib/Creator/FeedCreator.php index 907ca83..2df69a3 100644 --- a/lib/Creator/FeedCreator.php +++ b/lib/Creator/FeedCreator.php @@ -171,8 +171,8 @@ protected function _createStylesheetReferences() abstract public function createFeed(); /** - * Generate a filename for the feed cache file. The result will be $_SERVER["PHP_SELF"] with the extension changed - * to .xml. For example: echo $_SERVER["PHP_SELF"]."\n"; echo FeedCreator::_generateFilename(); would produce: + * Generate a filename for the feed cache file. The result will be $_SERVER["SCRIPT_NAME"] with the extension changed + * to .xml. For example: echo $_SERVER["SCRIPT_NAME"]."\n"; echo FeedCreator::_generateFilename(); would produce: * /rss/latestnews.php * latestnews.xml * @@ -182,7 +182,7 @@ abstract public function createFeed(); */ protected function _generateFilename() { - $fileInfo = pathinfo($_SERVER["PHP_SELF"]); + $fileInfo = pathinfo($_SERVER["SCRIPT_NAME"]); return substr($fileInfo["basename"], 0, -(strlen($fileInfo["extension"]) + 1)).".xml"; } @@ -227,7 +227,7 @@ protected function _redirect($filename) * * @since 1.4 * @param string $filename optional the filename where a recent version of the feed is saved. If not specified, - * the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see + * the filename is $_SERVER["SCRIPT_NAME"] with the extension changed to .xml (see * _generateFilename()). * @param int $timeout optional the timeout in seconds before a cached version is refreshed (defaults to * 3600 = 1 hour) @@ -249,7 +249,7 @@ public function useCached($filename = "", $timeout = 3600) * * @since 1.4 * @param string $filename optional the filename where a recent version of the feed is saved. If not - * specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml + * specified, the filename is $_SERVER["SCRIPT_NAME"] with the extension changed to .xml * (see _generateFilename()). * @param bool $displayContents optional send an HTTP redirect header or not. If true, the user will be * automatically redirected to the created file. diff --git a/lib/Creator/HTMLCreator.php b/lib/Creator/HTMLCreator.php index f0f03d8..28d4cf8 100644 --- a/lib/Creator/HTMLCreator.php +++ b/lib/Creator/HTMLCreator.php @@ -154,7 +154,7 @@ public function createFeed() */ protected function _generateFilename() { - $fileInfo = pathinfo($_SERVER["PHP_SELF"]); + $fileInfo = pathinfo($_SERVER["SCRIPT_NAME"]); return substr($fileInfo["basename"], 0, -(strlen($fileInfo["extension"]) + 1)).".html"; } diff --git a/lib/Creator/JSCreator.php b/lib/Creator/JSCreator.php index 5aa31fa..3e0a206 100644 --- a/lib/Creator/JSCreator.php +++ b/lib/Creator/JSCreator.php @@ -37,7 +37,7 @@ public function createFeed() */ protected function _generateFilename() { - $fileInfo = pathinfo($_SERVER["PHP_SELF"]); + $fileInfo = pathinfo($_SERVER["SCRIPT_NAME"]); return substr($fileInfo["basename"], 0, -(strlen($fileInfo["extension"]) + 1)).".js"; } diff --git a/lib/Creator/KMLCreator.php b/lib/Creator/KMLCreator.php index 31073d8..0ff6a0c 100644 --- a/lib/Creator/KMLCreator.php +++ b/lib/Creator/KMLCreator.php @@ -99,7 +99,7 @@ public function createFeed() */ protected function _generateFilename() { - $fileInfo = pathinfo($_SERVER["PHP_SELF"]); + $fileInfo = pathinfo($_SERVER["SCRIPT_NAME"]); return substr($fileInfo["basename"], 0, -(strlen($fileInfo["extension"]) + 1)).".kml"; } diff --git a/lib/Creator/MBOXCreator.php b/lib/Creator/MBOXCreator.php index 9198f1f..fc6d801 100644 --- a/lib/Creator/MBOXCreator.php +++ b/lib/Creator/MBOXCreator.php @@ -103,7 +103,7 @@ public function createFeed() */ protected function _generateFilename() { - $fileInfo = pathinfo($_SERVER["PHP_SELF"]); + $fileInfo = pathinfo($_SERVER["SCRIPT_NAME"]); return substr($fileInfo["basename"], 0, -(strlen($fileInfo["extension"]) + 1)).".mbox"; } diff --git a/lib/UniversalFeedCreator.php b/lib/UniversalFeedCreator.php index 4b7afe6..d84afa3 100644 --- a/lib/UniversalFeedCreator.php +++ b/lib/UniversalFeedCreator.php @@ -126,7 +126,7 @@ public function createFeed($format = "RSS0.91") * "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM", * "ATOM0.3", "HTML", "JS" * @param string $filename optional the filename where a recent version of the feed is saved. If not - * specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to + * specified, the filename is $_SERVER["SCRIPT_NAME"] with the extension changed to * .xml (see _generateFilename()). * @param boolean $displayContents optional send the content of the file or not. If true, the file will be sent * in the body of the response. @@ -147,7 +147,7 @@ public function saveFeed($format = "RSS0.91", $filename = "", $displayContents = * @param string $format format the feed should comply to. Valid values are: * "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM0.3". * @param string $filename optional the filename where a recent version of the feed is saved. If not specified, the - * filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see + * filename is $_SERVER["SCRIPT_NAME"] with the extension changed to .xml (see * _generateFilename()). * @param int $timeout optional the timeout in seconds before a cached version is refreshed (defaults to 3600 = * 1 hour)