diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-07-02 21:42:54 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-07-02 21:42:54 +0000 |
commit | 98fc394eb350d55c1876ffe8ce02260113af1368 (patch) | |
tree | 154800d957fd61fcac225e679fdbe475627d02b4 /phpBB/includes/functions.php | |
parent | fdd82e4c124ea2c28ae86b837ba629de206c22a0 (diff) | |
download | forums-98fc394eb350d55c1876ffe8ce02260113af1368.tar forums-98fc394eb350d55c1876ffe8ce02260113af1368.tar.gz forums-98fc394eb350d55c1876ffe8ce02260113af1368.tar.bz2 forums-98fc394eb350d55c1876ffe8ce02260113af1368.tar.xz forums-98fc394eb350d55c1876ffe8ce02260113af1368.zip |
- fixed language pack management a bit (supporting backslashes)
- fixed ftp_fsock, also fixing a reported bug in there
git-svn-id: file:///svn/phpbb/trunk@6139 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4f62fa3100..86f002d14e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2073,25 +2073,40 @@ function extension_allowed($forum_id, $extension, &$extensions) // Little helpers /** +* Little helper for the build_hidden_fields function +*/ +function _build_hidden_fields($key, $value, $specialchar) +{ + $hidden_fields = ''; + + if (!is_array($value)) + { + $key = ($specialchar) ? htmlspecialchars($key) : $key; + $value = ($specialchar) ? htmlspecialchars($value) : $value; + + $hidden_fields .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n"; + } + else + { + foreach ($value as $_key => $_value) + { + $hidden_fields .= _build_hidden_fields($key . '[' . $_key . ']', $_value, $specialchar); + } + } + + return $hidden_fields; +} + +/** * Build simple hidden fields from array */ -function build_hidden_fields($field_ary) +function build_hidden_fields($field_ary, $specialchar = false) { $s_hidden_fields = ''; foreach ($field_ary as $name => $vars) { - if (is_array($vars)) - { - foreach ($vars as $key => $value) - { - $s_hidden_fields .= '<input type="hidden" name="' . $name . '[' . $key . ']" value="' . $value . '" />'; - } - } - else - { - $s_hidden_fields .= '<input type="hidden" name="' . $name . '" value="' . $vars . '" />'; - } + $s_hidden_fields .= _build_hidden_fields($name, $vars, $specialchar); } return $s_hidden_fields; |