Fix more bugs
This commit is contained in:
		| @ -38,9 +38,7 @@ class Album { | |||||||
|         $this->thumbnail = $root->{'thumbnail'}; |         $this->thumbnail = $root->{'thumbnail'}; | ||||||
|         $this->images = $root->{'images'}; |         $this->images = $root->{'images'}; | ||||||
|         if (property_exists($root, 'metadata')) { |         if (property_exists($root, 'metadata')) { | ||||||
|             $this->metadata = $root->{'metadata'}; |             $this->metadata; | ||||||
|         } else { |  | ||||||
|             $this->metadata = null; |  | ||||||
|         }  |         }  | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @ -129,12 +127,27 @@ class Album { | |||||||
|                 'longitude' => '' |                 'longitude' => '' | ||||||
|             ]; |             ]; | ||||||
|         } |         } | ||||||
|         $description = $this->metadata->{$image}->{'description'}; |         $description = null; | ||||||
|         $date = $this->metadata->{$image}->{'date'}; |         $date = null; | ||||||
|         $time = $this->metadata->{$image}->{'time'}; |         $time = null; | ||||||
|         $lat= $this->metadata->{$image}->{'latitude'}; |         $lat = null; | ||||||
|         $lon = $this->metadata->{$image}->{'longitude'}; |         $lon = null; | ||||||
|         if (preg_match($this::NUMBER_REGEX, $lat) === false || preg_match($this::NUMBER_REGEX, $lon) === false) { |         if (property_exists($this->metadata->{$image}, 'description')) { | ||||||
|  |             $description = $this->metadata->{$image}?->{'description'}; | ||||||
|  |         } | ||||||
|  |         if (property_exists($this->metadata->{$image}, 'date')) { | ||||||
|  |             $date = $this->metadata->{$image}?->{'date'}; | ||||||
|  |         } | ||||||
|  |         if (property_exists($this->metadata->{$image}, 'time')) { | ||||||
|  |             $time = $this->metadata->{$image}?->{'time'}; | ||||||
|  |         } | ||||||
|  |         if (property_exists($this->metadata->{$image}, 'latitude')) { | ||||||
|  |             $lat= $this->metadata->{$image}?->{'latitude'}; | ||||||
|  |         } | ||||||
|  |         if (property_exists($this->metadata->{$image}, 'longitude')) { | ||||||
|  |             $lon = $this->metadata->{$image}?->{'longitude'}; | ||||||
|  |         } | ||||||
|  |         if ($lat && $lon && (preg_match($this::NUMBER_REGEX, $lat) === false || preg_match($this::NUMBER_REGEX, $lon) === false)) { | ||||||
|             $lat = null; |             $lat = null; | ||||||
|             $lon = null; |             $lon = null; | ||||||
|         } |         } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user