| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0f22ebe commit 3e35e16
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,6 +45,7 @@ | |||
| 45 | 45 | // As the deliberate awkwardly-named local variable $_txpfoo MUST NOT be unset to avoid notices further | |
| 46 | 46 | // down, we must remove any potential identically-named global from the list of global names here. | |
| 47 | 47 | unset($_txpg['_txpfoo']); | |
| 48 | + | ||
| 48 | 49 | foreach ($_txpg as $_txpfoo => $value) { | |
| 49 | 50 | if (!in_array($_txpfoo, array( | |
| 50 | 51 | 'GLOBALS', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,76 +21,77 @@ | |||
| 21 | 21 | * along with Textpattern. If not, see <http://www.gnu.org/licenses/>. | |
| 22 | 22 | */ | |
| 23 | 23 | ||
| 24 | - // Make sure we display all errors that occur during initialisation. | ||
| 25 | - error_reporting(E_ALL | E_STRICT); | ||
| 26 | - @ini_set("display_errors", "1"); | ||
| 24 | + // Make sure we display all errors that occur during initialisation. | ||
| 25 | + error_reporting(E_ALL | E_STRICT); | ||
| 26 | + @ini_set("display_errors", "1"); | ||
| 27 | 27 | ||
| 28 | - if (@ini_get('register_globals')) { | ||
| 29 | - if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) { | ||
| 30 | - die('GLOBALS overwrite attempt detected. Please consider turning register_globals off.'); | ||
| 31 | - } | ||
| 28 | + if (@ini_get('register_globals')) { | ||
| 29 | + if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) { | ||
| 30 | + die('GLOBALS overwrite attempt detected. Please consider turning register_globals off.'); | ||
| 31 | + } | ||
| 32 | 32 | ||
| 33 | - // Collect and unset all registered variables from globals. | ||
| 34 | - $_txpg = array_merge( | ||
| 35 | - isset($_SESSION) ? (array) $_SESSION : array(), | ||
| 36 | - (array) $_ENV, | ||
| 37 | - (array) $_GET, | ||
| 38 | - (array) $_POST, | ||
| 39 | - (array) $_COOKIE, | ||
| 40 | - (array) $_FILES, | ||
| 41 | - (array) $_SERVER); | ||
| 33 | + // Collect and unset all registered variables from globals. | ||
| 34 | + $_txpg = array_merge( | ||
| 35 | + isset($_SESSION) ? (array) $_SESSION : array(), | ||
| 36 | + (array) $_ENV, | ||
| 37 | + (array) $_GET, | ||
| 38 | + (array) $_POST, | ||
| 39 | + (array) $_COOKIE, | ||
| 40 | + (array) $_FILES, | ||
| 41 | + (array) $_SERVER); | ||
| 42 | 42 | ||
| 43 | - // As the deliberately awkward-named local variable $_txpfoo MUST NOT be unset to avoid notices further | ||
| 44 | - // down, we must remove any potentially identical-named global from the list of global names here. | ||
| 45 | - unset($_txpg['_txpfoo']); | ||
| 46 | - foreach ($_txpg as $_txpfoo => $value) { | ||
| 47 | - if (!in_array($_txpfoo, array( | ||
| 48 | - 'GLOBALS', | ||
| 49 | - '_SERVER', | ||
| 50 | - '_GET', | ||
| 51 | - '_POST', | ||
| 52 | - '_FILES', | ||
| 53 | - '_COOKIE', | ||
| 54 | - '_SESSION', | ||
| 55 | - '_REQUEST', | ||
| 56 | - '_ENV', | ||
| 57 | - ))) { | ||
| 58 | - unset($GLOBALS[$_txpfoo], $$_txpfoo); | ||
| 59 | - } | ||
| 43 | + // As the deliberately awkward-named local variable $_txpfoo MUST NOT be unset to avoid notices further | ||
| 44 | + // down, we must remove any potentially identical-named global from the list of global names here. | ||
| 45 | + unset($_txpg['_txpfoo']); | ||
| 46 | + | ||
| 47 | + foreach ($_txpg as $_txpfoo => $value) { | ||
| 48 | + if (!in_array($_txpfoo, array( | ||
| 49 | + 'GLOBALS', | ||
| 50 | + '_SERVER', | ||
| 51 | + '_GET', | ||
| 52 | + '_POST', | ||
| 53 | + '_FILES', | ||
| 54 | + '_COOKIE', | ||
| 55 | + '_SESSION', | ||
| 56 | + '_REQUEST', | ||
| 57 | + '_ENV', | ||
| 58 | + ))) { | ||
| 59 | + unset($GLOBALS[$_txpfoo], $$_txpfoo); | ||
| 60 | 60 | } | |
| 61 | 61 | } | |
| 62 | + } | ||
| 62 | 63 | ||
| 63 | - define("txpinterface", "public"); | ||
| 64 | + define("txpinterface", "public"); | ||
| 64 | 65 | ||
| 65 | - if (!defined('txpath')) { | ||
| 66 | - define("txpath", dirname(__FILE__).'/textpattern'); | ||
| 67 | - } | ||
| 66 | + if (!defined('txpath')) { | ||
| 67 | + define("txpath", dirname(__FILE__).'/textpattern'); | ||
| 68 | + } | ||
| 68 | 69 | ||
| 69 | - // Save server path to site root. | ||
| 70 | - if (!isset($here)) { | ||
| 71 | - $here = dirname(__FILE__); | ||
| 72 | - } | ||
| 70 | + // Save server path to site root. | ||
| 71 | + if (!isset($here)) { | ||
| 72 | + $here = dirname(__FILE__); | ||
| 73 | + } | ||
| 73 | 74 | ||
| 74 | - // Pull in config unless configuration data has already been provided (multi-headed use). | ||
| 75 | - if (!isset($txpcfg['table_prefix'])) { | ||
| 76 | - // Use buffering to ensure bogus whitespace in config.php is ignored. | ||
| 77 | - ob_start(NULL, 2048); | ||
| 78 | - include txpath.'/config.php'; | ||
| 79 | - ob_end_clean(); | ||
| 80 | - } | ||
| 75 | + // Pull in config unless configuration data has already been provided (multi-headed use). | ||
| 76 | + if (!isset($txpcfg['table_prefix'])) { | ||
| 77 | + // Use buffering to ensure bogus whitespace in config.php is ignored. | ||
| 78 | + ob_start(NULL, 2048); | ||
| 79 | + include txpath.'/config.php'; | ||
| 80 | + ob_end_clean(); | ||
| 81 | + } | ||
| 81 | 82 | ||
| 82 | - include txpath.'/lib/constants.php'; | ||
| 83 | - include txpath.'/lib/txplib_misc.php'; | ||
| 83 | + include txpath.'/lib/constants.php'; | ||
| 84 | + include txpath.'/lib/txplib_misc.php'; | ||
| 84 | 85 | ||
| 85 | - if (!isset($txpcfg['table_prefix'])) { | ||
| 86 | - txp_status_header('503 Service Unavailable'); | ||
| 87 | - exit('config.php is missing or corrupt. To install Textpattern, visit <a href="./textpattern/setup/">textpattern/setup/</a>'); | ||
| 88 | - } | ||
| 86 | + if (!isset($txpcfg['table_prefix'])) { | ||
| 87 | + txp_status_header('503 Service Unavailable'); | ||
| 88 | + exit('config.php is missing or corrupt. To install Textpattern, visit <a href="./textpattern/setup/">textpattern/setup/</a>'); | ||
| 89 | + } | ||
| 89 | 90 | ||
| 90 | - // Custom caches, et cetera? | ||
| 91 | - if (isset($txpcfg['pre_publish_script'])) { | ||
| 92 | - require $txpcfg['pre_publish_script']; | ||
| 93 | - } | ||
| 91 | + // Custom caches, et cetera? | ||
| 92 | + if (isset($txpcfg['pre_publish_script'])) { | ||
| 93 | + require $txpcfg['pre_publish_script']; | ||
| 94 | + } | ||
| 94 | 95 | ||
| 95 | - include txpath.'/publish.php'; | ||
| 96 | - textpattern(); | ||
| 96 | + include txpath.'/publish.php'; | ||
| 97 | + textpattern(); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments