diff options
Diffstat (limited to 'pmwiki.php')
-rw-r--r-- | pmwiki.php | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -246,6 +246,8 @@ $Conditions['group'] = "(boolean)MatchPageNames(\$pagename, FixGlob(\$condparm, '$1$2.*'))"; $Conditions['name'] = "(boolean)MatchPageNames(\$pagename, FixGlob(\$condparm, '$1*.$2'))"; +$Conditions['action'] = + "(boolean)MatchNames(\$GLOBALS['action'], \$condparm, false)"; $Conditions['match'] = 'preg_match("!$condparm!",$pagename)'; $Conditions['authid'] = 'NoCache(@$GLOBALS["AuthId"] > "")'; $Conditions['equal'] = 'CompareArgs($condparm) == 0'; @@ -624,6 +626,17 @@ function ParseArgs($x, $optpat = '(?>(\\w+)[:=])') { } return $z; } +function PosArgs($args, $posnames) { + if (is_string($args)) $args = ParseArgs($args); + if (!is_array($posnames)) { + $posnames = array_slice(func_get_args(), 1); + } + while (count($posnames) > 0 && isset($args['']) && count($args['']) > 0) { + $n = array_shift($posnames); + if (!isset($args[$n])) $args[$n] = array_shift($args['']); + } + return $args; +} function PHSC($x, $flags=ENT_COMPAT, $enc=null, $dbl_enc=true) { # for PHP 5.4 if (is_null($enc)) $enc = "ISO-8859-1"; # single-byte charset if (! is_array($x)) return @htmlspecialchars($x, $flags, $enc, $dbl_enc); |