aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-26 12:47:14 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-26 12:47:14 +0000
commit08070561a69db8dc17f9207079937135228603ec (patch)
tree2a8b2060ca29b7bd18ed4c9b9384f983ee6f6e1e /engine/lib
parent600f40002b2b3e59135146df493bf89401434ff4 (diff)
downloadelgg-08070561a69db8dc17f9207079937135228603ec.tar.gz
elgg-08070561a69db8dc17f9207079937135228603ec.tar.bz2
Refs #3239 added a new sticky forms function to grab all variables and integrated into blog plugin
git-svn-id: http://code.elgg.org/elgg/trunk@8836 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/input.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/engine/lib/input.php b/engine/lib/input.php
index c3fabbe5d..25416b868 100644
--- a/engine/lib/input.php
+++ b/engine/lib/input.php
@@ -181,6 +181,30 @@ function elgg_get_sticky_value($form_name, $variable = '', $default = NULL, $fil
}
/**
+ * Get all the values in a sticky form in an array
+ *
+ * @param string $form_name The name of the form
+ * @param bool $filter_result Filter for bad input if true
+ *
+ * @return array
+ * @since 1.8.0
+ */
+function elgg_get_sticky_values($form_name, $filter_result = true) {
+ if (!isset($_SESSION['sticky_forms'][$form_name])) {
+ return array();
+ }
+
+ $values = $_SESSION['sticky_forms'][$form_name];
+ if ($filter_result) {
+ foreach ($values as $key => $value) {
+ // XSS filter result
+ $values[$key] = filter_tags($value);
+ }
+ }
+ return $values;
+}
+
+/**
* Clear a specific sticky variable
*
* @param string $form_name The name of the form