From 0c4b59d4da700906cd260400738e0f538293b829 Mon Sep 17 00:00:00 2001 From: Bruno Salzano Date: Mon, 8 Jul 2013 00:26:32 +0200 Subject: [PATCH 1/2] Added check to avoid that the validate() function will play null files --- src/mg/PAGI/Node/Node.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mg/PAGI/Node/Node.php b/src/mg/PAGI/Node/Node.php index 40f30b8..315b047 100644 --- a/src/mg/PAGI/Node/Node.php +++ b/src/mg/PAGI/Node/Node.php @@ -503,10 +503,12 @@ public function validate() $onError = $data['soundOnError']; if (is_array($onError)) { foreach ($onError as $msg) { - $this->addPrePromptMessage($msg); + if ($msg!=null) + $this->addPrePromptMessage($msg); } } else { - $this->addPrePromptMessage($onError); + if ($onError!=null) + $this->addPrePromptMessage($onError); } return false; } From 1c68c8cf60eaa7c9a1b3fc062798b5a21ef35c6a Mon Sep 17 00:00:00 2001 From: Bruno Salzano Date: Fri, 12 Jul 2013 07:53:47 +0200 Subject: [PATCH 2/2] simplified and improved check of null string in validate() --- src/mg/PAGI/Node/Node.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mg/PAGI/Node/Node.php b/src/mg/PAGI/Node/Node.php index 315b047..67b03b4 100644 --- a/src/mg/PAGI/Node/Node.php +++ b/src/mg/PAGI/Node/Node.php @@ -503,12 +503,12 @@ public function validate() $onError = $data['soundOnError']; if (is_array($onError)) { foreach ($onError as $msg) { - if ($msg!=null) - $this->addPrePromptMessage($msg); + $this->addPrePromptMessage($msg); } } else { - if ($onError!=null) + if (is_string($onError)) { $this->addPrePromptMessage($onError); + } } return false; }