| @@ 51-65 (lines=15) @@ | ||
| 48 | if(ini_get('allow_url_fopen')) |
|
| 49 | { |
|
| 50 | $fp = @fopen($filename, "r"); |
|
| 51 | if($fp) |
|
| 52 | { |
|
| 53 | $str = fgets($fp, 100); |
|
| 54 | if(strlen($str) > 0) |
|
| 55 | { |
|
| 56 | $isExists = 'true'; |
|
| 57 | $type = 'XML'; |
|
| 58 | if(stristr($str, 'tattertools')) $type = 'TTXML'; |
|
| 59 | ||
| 60 | $this->add('type', $type); |
|
| 61 | } |
|
| 62 | fclose($fp); |
|
| 63 | $resultMessage = $lang->found_xml_file; |
|
| 64 | } |
|
| 65 | else $resultMessage = $lang->cannot_url_file; |
|
| 66 | } |
|
| 67 | else $resultMessage = $lang->cannot_allow_fopen_in_phpini; |
|
| 68 | ||
| @@ 78-90 (lines=13) @@ | ||
| 75 | if(file_exists($realPath) && is_file($realPath)) $isExists = 'true'; |
|
| 76 | $this->add('exists', $isExists); |
|
| 77 | ||
| 78 | if($isExists == 'true') |
|
| 79 | { |
|
| 80 | $type = 'XML'; |
|
| 81 | ||
| 82 | $fp = fopen($realPath, "r"); |
|
| 83 | $str = fgets($fp, 100); |
|
| 84 | if(stristr($str, 'tattertools')) $type = 'TTXML'; |
|
| 85 | fclose($fp); |
|
| 86 | ||
| 87 | $this->add('type', $type); |
|
| 88 | $resultMessage = $lang->found_xml_file; |
|
| 89 | } |
|
| 90 | else $resultMessage = $lang->not_found_xml_file; |
|
| 91 | } |
|
| 92 | $this->add('result_message', $resultMessage); |
|
| 93 | } |
|