|
@@ -263,7 +263,7 @@ discard block |
|
|
block discarded – undo |
|
263
|
263
|
if(isset($org_arr['name']) and $this->config['orgname']) |
|
264
|
264
|
$orgname = trim($org_arr['name']); |
|
265
|
265
|
|
|
266
|
|
- if (isset($vcard_obj->fn[0])) |
|
|
266
|
+ if(isset($vcard_obj->fn[0])) |
|
267
|
267
|
$formattedname = $vcard_obj->fn[0]; |
|
268
|
268
|
|
|
269
|
269
|
$firstname = trim($name_arr['firstname']); |
|
@@ -668,7 +668,7 @@ discard block |
|
|
block discarded – undo |
|
668
|
668
|
if(array_key_exists('output_file', $this->config)) |
|
669
|
669
|
{ |
|
670
|
670
|
// build md5 hash of previous stored xml without <mod_time> Elements |
|
671
|
|
- $oldphonebhash = md5(preg_replace("/<mod_time>(\\d{10})/","",file_get_contents($this->config['output_file'],'r'),-1,$debugoldtsreplace)); |
|
|
671
|
+ $oldphonebhash = md5(preg_replace("/<mod_time>(\\d{10})/", "", file_get_contents($this->config['output_file'], 'r'), -1, $debugoldtsreplace)); |
|
672
|
672
|
$output = fopen($this->config['output_file'], 'w'); |
|
673
|
673
|
if($output) |
|
674
|
674
|
{ |
|
@@ -676,13 +676,13 @@ discard block |
|
|
block discarded – undo |
|
676
|
676
|
fclose($output); |
|
677
|
677
|
print " Saved to file " . $this->config['output_file'] . PHP_EOL; |
|
678
|
678
|
} |
|
679
|
|
- if (array_key_exists('output_and_upload', $this->config) and $this->config['output_and_upload']) |
|
|
679
|
+ if(array_key_exists('output_and_upload', $this->config) and $this->config['output_and_upload']) |
|
680
|
680
|
{ |
|
681
|
|
- $newphonebhash = md5(preg_replace("/<mod_time>(\\d{10})/","",file_get_contents($this->config['output_file'],'r'),-1,$debugnewtsreplace)); |
|
|
681
|
+ $newphonebhash = md5(preg_replace("/<mod_time>(\\d{10})/", "", file_get_contents($this->config['output_file'], 'r'), -1, $debugnewtsreplace)); |
|
682
|
682
|
print " INFO: Compare old and new phonebook file versions." . PHP_EOL . " INFO: old version: " . $oldphonebhash . PHP_EOL . " INFO: new version: " . $newphonebhash . PHP_EOL; |
|
683
|
683
|
if($oldphonebhash === $newphonebhash) |
|
684
|
684
|
{ |
|
685
|
|
- print " INFO: Same versions ==> No changes in phonebook or images" . PHP_EOL . " EXIT: No need to upload phonebook to the FRITZ!Box.". PHP_EOL; |
|
|
685
|
+ print " INFO: Same versions ==> No changes in phonebook or images" . PHP_EOL . " EXIT: No need to upload phonebook to the FRITZ!Box." . PHP_EOL; |
|
686
|
686
|
return 0; |
|
687
|
687
|
} |
|
688
|
688
|
else |