浏览代码

Notifications: Retains postback values if input was invalid.

Nate Jones 11 年之前
父节点
当前提交
44e0741fd3
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. 14 0
      resources/functions.php

+ 14 - 0
resources/functions.php

@@ -66,6 +66,20 @@
 		}
 	}
 
+	if (!function_exists('fix_postback')) {
+		function fix_postback($post_array) {
+			foreach ($post_array as $index => $value) {
+				if (is_array($value)) { fix_postback($value); }
+				else {
+					$value = str_replace('"', """, $value);
+					$value = str_replace("'", "'", $value);
+					$post_array[$index] = $value;
+				}
+			}
+			return $post_array;
+		}
+	}
+
 	if (!function_exists('uuid')) {
 		function uuid() {
 			//uuid version 4