Check for and initialise in EOS to prevent notices

This commit is contained in:
Brian Miyaji
2014-05-12 11:23:39 +10:00
parent dd4926f22b
commit a49079ad3b

View File

@@ -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;
}