summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 30ad5a8)
raw | patch | inline | side by side (parent: 30ad5a8)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 8 Jul 2010 11:17:41 +0000 (11:17 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 8 Jul 2010 11:17:41 +0000 (11:17 +0000) |
-one to savely fetch binary content from an HTML input field
- and one to assign input field valid value back to the smarty templates
this allows us to use < > ' " in names, descriptions..
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18963 594d385d-05f5-0310-b6e9-bd551577e9d8
- and one to assign input field valid value back to the smarty templates
this allows us to use < > ' " in names, descriptions..
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18963 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/functions.inc | patch | blob | history |
index 993fc46c389b9fda3dd9648fa89ea9c08a4cfbc5..eaa1be78c7a4ce192232b331724de9229fa0e049 100644 (file)
}
+/*! \brief Returns contents of the given POST variable and check magic quotes settings
+ *
+ * Depending on the magic quotes settings this returns a stripclashed'ed version of
+ * a certain POST variable.
+ *
+ * \param string 'name' the POST var to return ($_POST[$name])
+ * \return string
+ * */
+function get_binary_post($name)
+{
+ if(!isset($_POST[$name])){
+ trigger_error("Requested POST value (".$name.") does not exists, you should add a check to prevent this message.");
+ return(FALSE);
+ }
+
+ $p = str_replace('\0', '', $_POST[$name]);
+ if(get_magic_quotes_gpc()){
+ return(stripcslashes($p));
+ }else{
+ return($_POST[$p]);
+ }
+}
+
+function set_post($value)
+{
+ return(htmlentities($value, ENT_QUOTES, 'utf-8'));
+}
+
+
/*! \brief Return class name in correct case */
function get_correct_class_name($cls)
{