From a49079ad3bf58e72879991a70d958cd24a345849 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Mon, 12 May 2014 11:23:39 +1000 Subject: [PATCH] Check for and initialise in EOS to prevent notices --- includes/libraries/class-eqeos.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/libraries/class-eqeos.php b/includes/libraries/class-eqeos.php index 7358dd34..90b2fdb5 100644 --- a/includes/libraries/class-eqeos.php +++ b/includes/libraries/class-eqeos.php @@ -181,8 +181,11 @@ class eqEOS { // if the character is numerical if(preg_match('/[0-9.]/i', $chr)) { // if the previous character was not a '-' or a number - if((!preg_match('/[0-9.]/i', $lChar) && ($lChar != "")) && (@$pf[$pfIndex]!="-")) + if((!preg_match('/[0-9.]/i', $lChar) && ($lChar != "")) && (array_key_exists($pfIndex, @$pf) && @$pf[$pfIndex]!="-")) $pfIndex++; // increase the index so as not to overlap anything + // if the array key doesn't exist + if(!array_key_exists($pfIndex, @$pf)) + @$pf[$pfIndex] = null; // add index to the array // Add the number character to the array @$pf[$pfIndex] .= $chr; }