aboutsummaryrefslogtreecommitdiff
path: root/pmwiki.php
diff options
context:
space:
mode:
authorpetko <petko@524c5546-5005-0410-9a3e-e25e191bd360>2024-02-10 06:17:16 +0000
committerpetko <petko@524c5546-5005-0410-9a3e-e25e191bd360>2024-02-10 06:17:16 +0000
commit0a67e7e373c2530e8ad2afddcfb350dc68307ac6 (patch)
tree5d11f1275688a023d87e24ec3b9f34a1b33fc876 /pmwiki.php
parent9765dc25855665c6ed8f29ccfaef232337760cbd (diff)
downloadpmwiki.svn-0a67e7e373c2530e8ad2afddcfb350dc68307ac6.tar.bz2
Refactor $PostConfig to allow called functions to update it.
git-svn-id: svn://pmwiki.org/pmwiki/trunk@4620 524c5546-5005-0410-9a3e-e25e191bd360
Diffstat (limited to 'pmwiki.php')
-rw-r--r--pmwiki.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/pmwiki.php b/pmwiki.php
index 6c124b5f..e7e2c173 100644
--- a/pmwiki.php
+++ b/pmwiki.php
@@ -417,6 +417,8 @@ if (strpos($pagename, "$FarmPubDirPrefix/")===0) {
exit;
}
+$PostConfig = array();
+
if (file_exists("$FarmD/local/farmconfig.php"))
include_once("$FarmD/local/farmconfig.php");
if (@$IsPmArchive && file_exists("$PmArchiveDir/local/farmconfig.php"))
@@ -435,15 +437,17 @@ SDV($CurrentTimeISO, PSFT($TimeISOFmt, $Now));
if (IsEnabled($EnableStdConfig,1))
include_once("$FarmD/scripts/stdconfig.php");
-if (isset($PostConfig) && is_array($PostConfig)) {
- asort($PostConfig, SORT_NUMERIC);
- foreach ($PostConfig as $k=>$v) {
- if (!$k || !$v || $v<50) continue;
- if (function_exists($k)) $k($pagename);
- elseif (file_exists($k)) include_once($k);
- }
+asort($PostConfig, SORT_NUMERIC);
+while(count($PostConfig)) {
+ $k = array_key_first($PostConfig);
+ $v = $PostConfig[$k];
+ array_shift($PostConfig);
+ if (!$k || !$v || $v<50) continue;
+ if (function_exists($k)) $k($pagename);
+ elseif (file_exists($k)) include_once($k);
}
+
function pmsetcookie($name, $val="", $exp=0, $path="", $dom="", $secure=null, $httponly=null, $samesite=null) {
global $EnableCookieSecure, $EnableCookieHTTPOnly, $SetCookieFunction, $CookieSameSite;
if (IsEnabled($SetCookieFunction))