diff --git a/application/libraries/Adif_parser.php b/application/libraries/Adif_parser.php index 7368f7c5..06f6fc52 100644 --- a/application/libraries/Adif_parser.php +++ b/application/libraries/Adif_parser.php @@ -21,7 +21,7 @@ class ADIF_Parser var $data; //the adif data var $datasplit; // one entry is one QSO in the array var $currentarray = 0; // current place in the array - var $i; //the iterator + var $i = 0; //the iterator var $headers = array(); public function initialize() //this function locates the @@ -29,6 +29,11 @@ class ADIF_Parser $pos = mb_stripos(mb_strtoupper($this->data, "UTF-8"), "", 0, "UTF-8"); + $in_tag = false; + $tag = ""; + $value_length = ""; + $value = ""; + if($pos == false) //did we find the end of headers? { // Just skip if we did not find (optional) headers @@ -36,14 +41,6 @@ class ADIF_Parser goto noheaders; }; - //get headers - - $this->i = 0; - $in_tag = false; - $tag = ""; - $value_length = ""; - $value = ""; - while($this->i < $pos) { //skip comments