com web/php: Swap uses of _SERVER[DOCUMENT_ROOT] for __DIR__: backend/index.php bin/index.php conferences/index.php error.php images/elephpants. php
images/index.php images/supported-versions.php js /search-index.php license/contrib-guidelines-code.php l icense/distrib-guidelines-code.php
license/index.php ma nual/add-note.php manual/change.php manual/en/book.va r.php manual/en/class.exception.php manual/en/context .http.php
manual/en/funcref.php manua

From: Date: Fri, 31 May 2019 16:31:21 +0000
Subject: com web/php: Swap uses of _SERVER[DOCUMENT_ROOT] for __DIR__: backend/index.php bin/index.php conferences/index.php error.php images/elephpants. php
images/index.php images/supported-versions.php js /search-index.php license/contrib-guidelines-code.php l icense/distrib-guidelines-code.php
license/index.php ma nual/add-note.php manual/change.php manual/en/book.va r.php manual/en/class.exception.php manual/en/context .http.php
manual/en/funcref.php manua
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-28126@lists.php.net to get a copy of this message
Commit: c0afd74bf75f68d6939050fa0989e56aedaecacd Author: Sara Golemon <pollita@php.net> Fri, 31 May 2019 12:22:58 -0400 Parents: 2735e5f03fd7d7443eea5cf95e2094a2f539e3d0 Branches: master Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=c0afd74bf75f68d6939050fa0989e56aedaecacd Log: Swap uses of _SERVER[DOCUMENT_ROOT] for __DIR__ 2/4 - Update remaining except archives/ and release/. Changed paths: M backend/index.php M bin/index.php M conferences/index.php M error.php M images/elephpants.php M images/index.php M images/supported-versions.php M js/search-index.php M license/contrib-guidelines-code.php M license/distrib-guidelines-code.php M license/index.php M manual/add-note.php M manual/change.php M manual/en/book.var.php M manual/en/class.exception.php M manual/en/context.http.php M manual/en/funcref.php M manual/en/function.strpos.php M manual/en/index.php M manual/en/language.exceptions.php M manual/en/refs.basic.vartype.php M manual/help-translate.php M manual/index.php M manual/php3.php M manual/php4.php M manual/phpfi2.php M manual/vote-note.php M pear/index.php M security/crypt_blowfish.php M security/index.php M stats/index.php M styles/index.php

diff --git a/backend/index.php b/backend/index.php index a63cd75..0a246ae 100644 --- a/backend/index.php +++ b/backend/index.php @@ -1,5 +1,5 @@ <?php // Simulate a /backend shortcut call (which will lead to a manual page) $_SERVER['REQUEST_URI'] = '/backend'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/error.php'; +include_once __DIR__ . '/../include/prepend.inc'; +include_once __DIR__ . '/../error.php'; diff --git a/bin/index.php b/bin/index.php index c0a6c92..f3e722c 100644 --- a/bin/index.php +++ b/bin/index.php @@ -1,5 +1,5 @@ <?php // Simulate a /bin shortcut call (which will lead to a manual page) $_SERVER['REQUEST_URI'] = '/bin'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/error.php'; +include_once __DIR__ . '/../include/prepend.inc'; +include_once __DIR__ . '/../error.php'; diff --git a/conferences/index.php b/conferences/index.php index d63202f..14daf18 100644 --- a/conferences/index.php +++ b/conferences/index.php @@ -1,7 +1,7 @@ <?php $_SERVER['BASE_PAGE'] = 'conferences/index.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/pregen-news.inc'; +include_once __DIR__ . '/../include/prepend.inc'; +include_once __DIR__ . '/../include/pregen-news.inc'; mirror_setcookie("LAST_NEWS", $_SERVER["REQUEST_TIME"], 60*60*24*365); diff --git a/error.php b/error.php index 3cf8b6c..5ec75cb 100644 --- a/error.php +++ b/error.php @@ -149,7 +149,7 @@ if (preg_match("!^get/([^/]+)/from/([^/]+)(/mirror)?$!", $URI, $dlinfo)) { } // Start the download process - include $_SERVER['DOCUMENT_ROOT'] . "/include/do-download.inc"; + include __DIR__ . "/include/do-download.inc"; $filename = get_actual_download_file($df); if ($filename) { status_header(200); @@ -157,7 +157,7 @@ if (preg_match("!^get/([^/]+)/from/([^/]+)(/mirror)?$!", $URI, $dlinfo)) { } else { status_header(404); /* The file didn't exist on this server.. ask the user to pick another mirror */ - include $_SERVER['DOCUMENT_ROOT'] . "/include/get-download.inc"; + include __DIR__ . "/include/get-download.inc"; } exit; } diff --git a/images/elephpants.php b/images/elephpants.php index be39aa5..4b51650 100644 --- a/images/elephpants.php +++ b/images/elephpants.php @@ -1,5 +1,5 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/../include/prepend.inc'; $now = $_SERVER["REQUEST_TIME"]; if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"])) { diff --git a/images/index.php b/images/index.php index 8e046b4..9e64d3f 100644 --- a/images/index.php +++ b/images/index.php @@ -1,5 +1,5 @@ <?php // Simulate a /images shortcut call (which will lead to a manual page) $_SERVER['REQUEST_URI'] = '/images'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/error.php'; +include_once __DIR__ . '/../include/prepend.inc'; +include_once __DIR__ . '/../error.php'; diff --git a/images/supported-versions.php b/images/supported-versions.php index f636388..4b29f23 100644 --- a/images/supported-versions.php +++ b/images/supported-versions.php @@ -1,6 +1,6 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/branches.inc'; +include_once __DIR__ . '/../include/prepend.inc'; +include_once __DIR__ . '/../include/branches.inc'; // Sizing constants. $margin_left = 80; diff --git a/js/search-index.php b/js/search-index.php index 614b323..1381861 100644 --- a/js/search-index.php +++ b/js/search-index.php @@ -7,7 +7,7 @@ if (!isset($_GET["lang"])) { if (empty($_SERVER["DOCUMENT_ROOT"])) { $_SERVER["DOCUMENT_ROOT"] = __DIR__ . "/../"; } -include $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include __DIR__ . '/../include/prepend.inc'; if (!isset($ACTIVE_ONLINE_LANGUAGES[$_GET["lang"]])) { header("Location: http://php.net"); } diff --git a/license/contrib-guidelines-code.php b/license/contrib-guidelines-code.php index 5dc5025..10ab5db 100644 --- a/license/contrib-guidelines-code.php +++ b/license/contrib-guidelines-code.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'license/contrib-guidelines-code.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/../include/prepend.inc'; site_header("License Information", array("current" => "help")); ?> <h2>PHP Contributor Guidelines for Code Developers</h2> diff --git a/license/distrib-guidelines-code.php b/license/distrib-guidelines-code.php index 6b28f82..2f2b6e1 100644 --- a/license/distrib-guidelines-code.php +++ b/license/distrib-guidelines-code.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'license/distrib-guidelines-code.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/../include/prepend.inc'; site_header("License Information", array("current" => "help")); ?> <h2>PHP Distribution Guidelines</h2> diff --git a/license/index.php b/license/index.php index ba41215..848fbbb 100644 --- a/license/index.php +++ b/license/index.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'license/index.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/../include/prepend.inc'; $SIDEBAR_DATA = <<<EOF <aside> diff --git a/manual/add-note.php b/manual/add-note.php index e9d2f4c..8203c17 100644 --- a/manual/add-note.php +++ b/manual/add-note.php @@ -2,10 +2,10 @@ $ip_spam_lookup_url = 'http://www.dnsbl.info/dnsbl-database-check.php?IP='; $_SERVER['BASE_PAGE'] = 'manual/add-note.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/posttohost.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; -include $_SERVER['DOCUMENT_ROOT'] . '/manual/spam_challenge.php'; +include_once __DIR__ . '/../include/prepend.inc'; +include_once __DIR__ . '/../include/posttohost.inc'; +include_once __DIR__ . '/../include/shared-manual.inc'; +include __DIR__ . '/spam_challenge.php'; site_header("Add Manual Note", array( 'css' => 'add-note.css')); diff --git a/manual/change.php b/manual/change.php index 1716d20..5ce3e67 100644 --- a/manual/change.php +++ b/manual/change.php @@ -1,5 +1,5 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/../include/prepend.inc'; $page = isset($_GET['page']) ? htmlspecialchars($_GET['page'], ENT_QUOTES, 'UTF-8') : ''; $page = strtr($page, array("\r"=>"","\n"=>"")); diff --git a/manual/en/book.var.php b/manual/en/book.var.php index 085305b..b340514 100644 --- a/manual/en/book.var.php +++ b/manual/en/book.var.php @@ -1,5 +1,5 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; +include_once __DIR__ . '/../../include/shared-manual.inc'; $TOC = array(); $PARENTS = array(); include_once __DIR__ ."/toc/refs.basic.vartype.inc"; diff --git a/manual/en/class.exception.php b/manual/en/class.exception.php index 13397d7..1d65b45 100644 --- a/manual/en/class.exception.php +++ b/manual/en/class.exception.php @@ -1,5 +1,5 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; +include_once __DIR__ . '/../../include/shared-manual.inc'; $TOC = array(); $PARENTS = array(); include_once __DIR__ ."/toc/reserved.exceptions.inc"; diff --git a/manual/en/context.http.php b/manual/en/context.http.php index f7a3531..e51ae98 100644 --- a/manual/en/context.http.php +++ b/manual/en/context.http.php @@ -1,5 +1,5 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; +include_once __DIR__ . '/../../include/shared-manual.inc'; $TOC = array(); $PARENTS = array(); include_once __DIR__ ."/toc/context.inc"; diff --git a/manual/en/funcref.php b/manual/en/funcref.php index b22e8c1..98f1500 100644 --- a/manual/en/funcref.php +++ b/manual/en/funcref.php @@ -1,5 +1,5 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; +include_once __DIR__ . '/../../include/shared-manual.inc'; $TOC = array(); $PARENTS = array(); include_once __DIR__ ."/toc/index.inc"; diff --git a/manual/en/function.strpos.php b/manual/en/function.strpos.php index 995867e..97f5bb6 100644 --- a/manual/en/function.strpos.php +++ b/manual/en/function.strpos.php @@ -1,5 +1,5 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; +include_once __DIR__ . '/../../include/shared-manual.inc'; $TOC = array(); $PARENTS = array(); include_once __DIR__ ."/toc/ref.strings.inc"; diff --git a/manual/en/index.php b/manual/en/index.php index 0e16997..c8d167d 100644 --- a/manual/en/index.php +++ b/manual/en/index.php @@ -1,5 +1,5 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; +include_once __DIR__ . '/../../include/shared-manual.inc'; $TOC = array(); $PARENTS = array(); diff --git a/manual/en/language.exceptions.php b/manual/en/language.exceptions.php index 5ea9cad..261d9a6 100644 --- a/manual/en/language.exceptions.php +++ b/manual/en/language.exceptions.php @@ -1,5 +1,5 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; +include_once __DIR__ . '/../../include/shared-manual.inc'; $TOC = array(); $PARENTS = array(); include_once __DIR__ ."/toc/langref.inc"; diff --git a/manual/en/refs.basic.vartype.php b/manual/en/refs.basic.vartype.php index 9a051ba..df3937a 100644 --- a/manual/en/refs.basic.vartype.php +++ b/manual/en/refs.basic.vartype.php @@ -1,5 +1,5 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; +include_once __DIR__ . '/../../include/shared-manual.inc'; $TOC = array(); $PARENTS = array(); include_once __DIR__ ."/toc/funcref.inc"; diff --git a/manual/help-translate.php b/manual/help-translate.php index 65fe54e..577e5e1 100644 --- a/manual/help-translate.php +++ b/manual/help-translate.php @@ -1,7 +1,7 @@ <?php $_SERVER['BASE_PAGE'] = 'manual/help-translate.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; +include_once __DIR__ . '/../include/prepend.inc'; +include_once __DIR__ . '/../include/shared-manual.inc'; site_header("Help translate the PHP Manual"); ?> diff --git a/manual/index.php b/manual/index.php index 818d907..01404ed 100644 --- a/manual/index.php +++ b/manual/index.php @@ -1,4 +1,4 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/../include/prepend.inc'; mirror_redirect("/manual/$LANG/index.php"); ?> diff --git a/manual/php3.php b/manual/php3.php index 366c2f7..313e8c6 100644 --- a/manual/php3.php +++ b/manual/php3.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'manual/php3.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/../include/prepend.inc'; site_header('PHP Version 3 Documentation'); ?> diff --git a/manual/php4.php b/manual/php4.php index 8633445..9b3ab46 100644 --- a/manual/php4.php +++ b/manual/php4.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'manual/php4.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/../include/prepend.inc'; site_header('PHP Version 4 Documentation'); ?> diff --git a/manual/phpfi2.php b/manual/phpfi2.php index d8ca6bb..691bbc6 100644 --- a/manual/phpfi2.php +++ b/manual/phpfi2.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'manual/phpfi2.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/../include/prepend.inc'; site_header('PHP/FI Version 2.0 Documentation'); ?> diff --git a/manual/vote-note.php b/manual/vote-note.php index 5aca2e0..0cc5e15 100644 --- a/manual/vote-note.php +++ b/manual/vote-note.php @@ -1,9 +1,9 @@ <?php $_SERVER['BASE_PAGE'] = 'manual/vote-note.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/posttohost.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; -include $_SERVER['DOCUMENT_ROOT'] . '/manual/spam_challenge.php'; +include_once __DIR__ . '/../include/prepend.inc'; +include_once __DIR__ . '/../include/posttohost.inc'; +include_once __DIR__ . '/../include/shared-manual.inc'; +include __DIR__ . '/spam_challenge.php'; // Initialize global variables $error = false; diff --git a/pear/index.php b/pear/index.php index de92ee7..7b2cb89 100644 --- a/pear/index.php +++ b/pear/index.php @@ -1,5 +1,5 @@ <?php // Simulate a /pear shortcut call (which will lead to a manual page) $_SERVER['REQUEST_URI'] = '/pear'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/error.php'; +include_once __DIR__ . '/../include/prepend.inc'; +include_once __DIR__ . '/../error.php'; diff --git a/security/crypt_blowfish.php b/security/crypt_blowfish.php index 402f1f8..e418520 100644 --- a/security/crypt_blowfish.php +++ b/security/crypt_blowfish.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'security/index.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/../include/prepend.inc'; site_header("CRYPT_BLOWFISH security fix details"); ?> diff --git a/security/index.php b/security/index.php index bb26eaf..dbccfbc 100644 --- a/security/index.php +++ b/security/index.php @@ -1,7 +1,7 @@ <?php $_SERVER['BASE_PAGE'] = 'security/index.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/../include/prepend.inc'; if(!isset($_COOKIE["MAGIC_COOKIE"])) { mirror_redirect("/manual/security"); exit; diff --git a/stats/index.php b/stats/index.php index a4a270d..de177cb 100644 --- a/stats/index.php +++ b/stats/index.php @@ -5,7 +5,7 @@ which means there is no local search is set up */ $_SERVER['BASE_PAGE'] = 'stats/index.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/../include/prepend.inc'; site_header("No Stats"); ?> diff --git a/styles/index.php b/styles/index.php index aa1f979..960d9a9 100644 --- a/styles/index.php +++ b/styles/index.php @@ -1,5 +1,5 @@ <?php // Simulate a /styles shortcut call (which will lead to a manual page) $_SERVER['REQUEST_URI'] = '/styles'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/error.php'; +include_once __DIR__ . '/../include/prepend.inc'; +include_once __DIR__ . '/../error.php';
« previous php.webmaster (#28126) next »