Checking array indexes before using them (#1)
This commit is contained in:
parent
a2c3ade47f
commit
a1edd4f01c
|
@ -39,8 +39,10 @@ function getNGGalleryImages( $ngGalleries, $ngImages, $dt, $lat, $lon, $dtoffset
|
|||
if ( is_callable( 'exif_read_data' ) ) {
|
||||
$exif = @exif_read_data( $p->imagePath );
|
||||
if ( $exif !== false ) {
|
||||
$item['lon'] = getExifGps( $exif['GPSLongitude'], $exif['GPSLongitudeRef'] );
|
||||
$item['lat'] = getExifGps( $exif['GPSLatitude'], $exif['GPSLatitudeRef'] );
|
||||
$item['lon'] = (array_key_exists('GPSLongiture', $exif) and array_key_exists('GPSLongitudeRef', $exif)) ?
|
||||
getExifGps( $exif['GPSLongitude'], $exif['GPSLongitudeRef'] ) : 0;
|
||||
$item['lat'] = (array_key_exists('GPSLatitude', $exif) and array_key_exists('GPSLatitudeRef', $exif)) ?
|
||||
getExifGps( $exif['GPSLatitude'], $exif['GPSLatitudeRef'] ) : 0;
|
||||
if ( ( $item['lat'] != 0 ) || ( $item['lon'] != 0 ) ) {
|
||||
$result[] = $item;
|
||||
} elseif ( isset( $p->imagedate ) ) {
|
||||
|
|
Loading…
Reference in New Issue