From a3651c6ad71ec33286ae03908f4e91397ef04dd6 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 20 Jun 2012 06:56:46 +0000 Subject: [PATCH] preg_replace to eliminate bad character --- application/controllers/ComptageController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/controllers/ComptageController.php b/application/controllers/ComptageController.php index 1e591fe3..5af67ef5 100644 --- a/application/controllers/ComptageController.php +++ b/application/controllers/ComptageController.php @@ -90,6 +90,8 @@ class ComptageController extends Zend_Controller_Action require_once 'i18n/cleanchar.php'; $ref = str_replace(' ', '_', $ref); $ref = cleanutf8($ref); + $pattern = '/[^a-zA-Z0-9_]+/'; + $ref = preg_replace($pattern, '', $ref); if (empty($ref)) { echo json_encode(array(