diff --git a/lib/mfrc522/source/loop.php b/lib/mfrc522/source/loop.php index 52be934..1dc44b7 100755 --- a/lib/mfrc522/source/loop.php +++ b/lib/mfrc522/source/loop.php @@ -294,15 +294,15 @@ /* (1) Check file */ $gstate = $f_gstate->current(); - if( $f_gstate === false ) + if( !$gstate ) return 127; - /* (2) Remove surrounding spaces */ - $f_gstate = preg_replace('@^\s+@', '', $f_gstate); - $f_gstate = preg_replace('@\s+$@', '', $f_gstate); + /* (3) Remove surrounding spaces */ + $gstate = preg_replace('@^\s+@', '', $gstate); + $gstate = preg_replace('@\s+$@', '', $gstate); - /* (3) Manage error */ - if( strlen($state) < 1 ) + /* (4) Manage error */ + if( strlen($gstate) < 1 ) return 127; return 0;