[ADIF Parser] If EOH didn't exist, $i was never set. Init on declaration instead.
这个提交包含在:
父节点
2c40e9acad
当前提交
f37da1aab5
共有 1 个文件被更改,包括 6 次插入 和 9 次删除
|
|
@ -21,7 +21,7 @@ class ADIF_Parser
|
||||||
var $data; //the adif data
|
var $data; //the adif data
|
||||||
var $datasplit; // one entry is one QSO in the array
|
var $datasplit; // one entry is one QSO in the array
|
||||||
var $currentarray = 0; // current place in the array
|
var $currentarray = 0; // current place in the array
|
||||||
var $i; //the iterator
|
var $i = 0; //the iterator
|
||||||
var $headers = array();
|
var $headers = array();
|
||||||
|
|
||||||
public function initialize() //this function locates the <EOH>
|
public function initialize() //this function locates the <EOH>
|
||||||
|
|
@ -29,6 +29,11 @@ class ADIF_Parser
|
||||||
|
|
||||||
$pos = mb_stripos(mb_strtoupper($this->data, "UTF-8"), "<EOH>", 0, "UTF-8");
|
$pos = mb_stripos(mb_strtoupper($this->data, "UTF-8"), "<EOH>", 0, "UTF-8");
|
||||||
|
|
||||||
|
$in_tag = false;
|
||||||
|
$tag = "";
|
||||||
|
$value_length = "";
|
||||||
|
$value = "";
|
||||||
|
|
||||||
if($pos == false) //did we find the end of headers?
|
if($pos == false) //did we find the end of headers?
|
||||||
{
|
{
|
||||||
// Just skip if we did not find (optional) headers
|
// Just skip if we did not find (optional) headers
|
||||||
|
|
@ -36,14 +41,6 @@ class ADIF_Parser
|
||||||
goto noheaders;
|
goto noheaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
//get headers
|
|
||||||
|
|
||||||
$this->i = 0;
|
|
||||||
$in_tag = false;
|
|
||||||
$tag = "";
|
|
||||||
$value_length = "";
|
|
||||||
$value = "";
|
|
||||||
|
|
||||||
while($this->i < $pos)
|
while($this->i < $pos)
|
||||||
{
|
{
|
||||||
//skip comments
|
//skip comments
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用