Merge remote-tracking branch 'mike/master' into dev

This commit is contained in:
Mario Vavti 2018-03-14 11:37:24 +01:00
commit 461e86423a
3 changed files with 14 additions and 7 deletions

View File

@ -19,7 +19,7 @@ class Chanview extends \Zotlabs\Web\Controller {
} }
if($_REQUEST['address']) { if($_REQUEST['address']) {
$r = q("select * from xchan where xchan_addr = '%s' limit 1", $r = q("select * from xchan where xchan_addr = '%s' limit 1",
dbesc($_REQUEST['address']) dbesc(punify($_REQUEST['address']))
); );
} }
elseif(local_channel() && intval($_REQUEST['cid'])) { elseif(local_channel() && intval($_REQUEST['cid'])) {

View File

@ -289,7 +289,7 @@ abstract class photo_driver {
return false; return false;
} }
$ort = $exif['IFD0']['Orientation']; $ort = ((array_key_exists('IFD0',$exif)) ? $exif['IFD0']['Orientation'] : $exif['Orientation']);
if(! $ort) { if(! $ort) {
return false; return false;

View File

@ -333,10 +333,17 @@ function photo_upload($channel, $observer, $args) {
$lat = $lon = null; $lat = $lon = null;
if($exif && $exif['GPS']) { if($exif && feature_enabled($channel_id,'photo_location')) {
if(feature_enabled($channel_id,'photo_location')) { $gps = null;
$lat = getGps($exif['GPS']['GPSLatitude'], $exif['GPS']['GPSLatitudeRef']); if(array_key_exists('GPS',$exif)) {
$lon = getGps($exif['GPS']['GPSLongitude'], $exif['GPS']['GPSLongitudeRef']); $gps = $exif['GPS'];
}
elseif(array_key_exists('GPSLatitude',$exif)) {
$gps = $exif;
}
if($gps) {
$lat = getGps($gps['GPSLatitude'], $gps['GPSLatitudeRef']);
$lon = getGps($gps['GPSLongitude'], $gps['GPSLongitudeRef']);
} }
} }