diff options
author | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2022-07-25 11:14:31 +0000 |
---|---|---|
committer | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2022-07-25 11:14:31 +0000 |
commit | 2243aa15af35ee3fa78bbdaa62b63c3c1d5edb22 (patch) | |
tree | e237169ccff2e1e212737b31d72725a1cadad449 /scripts/forms.php | |
parent | d535eb1f35d59af5568e89219f48b8f5d3051e55 (diff) | |
download | pmwiki.svn-2243aa15af35ee3fa78bbdaa62b63c3c1d5edb22.tar.bz2 |
Add non-wildcard $DefaultUnsetPageTextVars to $InputValues array.
git-svn-id: svn://pmwiki.org/pmwiki/trunk@4139 524c5546-5005-0410-9a3e-e25e191bd360
Diffstat (limited to 'scripts/forms.php')
-rw-r--r-- | scripts/forms.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/forms.php b/scripts/forms.php index 4106df13..d6406d54 100644 --- a/scripts/forms.php +++ b/scripts/forms.php @@ -219,7 +219,7 @@ function InputMarkup($pagename, $type, $args) { ## (:input default:) directive. function InputDefault($pagename, $type, $args) { - global $InputValues, $PageTextVarPatterns, $PCache; + global $InputValues, $PageTextVarPatterns, $PCache, $DefaultUnsetPageTextVars, $DefaultEmptyPageTextVars; $args = ParseArgs($args); $args[''] = (array)@$args['']; $name = (isset($args['name'])) ? $args['name'] : array_shift($args['']); @@ -258,6 +258,21 @@ function InputDefault($pagename, $type, $args) { break; } } + if (is_array(@$DefaultUnsetPageTextVars)) { + foreach($DefaultUnsetPageTextVars as $k=>$v) { + if (!preg_match('/[?*]/', $k)) + SDVA($InputValues, array("ptv_$k"=>$v)); + } + } + if (is_array(@$DefaultEmptyPageTextVars)) { + foreach($DefaultUnsetPageTextVars as $k=>$v) { + if (!preg_match('/[?*]/', $k)) + if(isset($InputValues["ptv_$k"]) && $InputValues["ptv_$k"] === '') { + $InputValues["ptv_$k"] = $v; + } + } + } + return ''; } |