From 1770fab206cc9ff6ddd8fee3f421d2b7a865964f Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Mon, 9 Mar 2015 11:44:39 +1300 Subject: [PATCH] BUG Fix gridfield generating invalid session keys --- forms/gridfield/GridField.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/forms/gridfield/GridField.php b/forms/gridfield/GridField.php index 4c82f4e78..43bfc9b02 100644 --- a/forms/gridfield/GridField.php +++ b/forms/gridfield/GridField.php @@ -840,7 +840,8 @@ class GridField_FormAction extends FormAction { 'args' => $this->args, ); - $id = substr(md5(serialize($state)), 0, 8); + // Ensure $id doesn't contain only numeric characters + $id = 'gf_'.substr(md5(serialize($state)), 0, 8); Session::set($id, $state); $actionData['StateID'] = $id;