@@ -416,8 +416,15 @@ public static function upload($localFile, $name, $attributes = array())
416
416
$ attributes [$ default ] = null ;
417
417
}
418
418
419
- $ dateUploaded = time ();
420
- $ dateTaken = @$ exif ['dateTaken ' ];
419
+ if (isset ($ attributes ['dateUploaded ' ]) && !empty ($ attributes ['dateUploaded ' ]))
420
+ $ dateUploaded = $ attributes ['dateUploaded ' ];
421
+ else
422
+ $ dateUploaded = time ();
423
+
424
+ if (isset ($ attributes ['dateTaken ' ]) && !empty ($ attributes ['dateTaken ' ]))
425
+ $ dateTaken = $ attributes ['dateTaken ' ];
426
+ else
427
+ $ dateTaken = @$ exif ['dateTaken ' ];
421
428
422
429
if (getConfig ()->get ('photos ' )->autoTagWithDate == 1 )
423
430
{
@@ -614,7 +621,8 @@ private static function whitelistParams($attributes)
614
621
{
615
622
$ returnAttrs = array ();
616
623
$ matches = array ('id ' => 1 ,'host ' => 1 ,'appId ' => 1 ,'title ' => 1 ,'description ' => 1 ,'key ' => 1 ,'hash ' => 1 ,'tags ' => 1 ,'size ' => 1 ,'width ' => 1 ,'photo ' =>1 ,
617
- 'height ' => 1 ,'altitude ' => 1 , 'latitude ' => 1 ,'longitude ' => 1 ,'views ' => 1 ,'status ' => 1 ,'permission ' => 1 ,'groups ' => 1 ,'license ' => 1 );
624
+ 'height ' => 1 ,'altitude ' => 1 , 'latitude ' => 1 ,'longitude ' => 1 ,'views ' => 1 ,'status ' => 1 ,'permission ' => 1 ,'groups ' => 1 ,'license ' => 1 ,
625
+ 'dateTaken ' => 1 , 'dateUploaded ' => 1 );
618
626
$ patterns = array ('exif.* ' => 1 ,'date.* ' => 1 ,'path.* ' => 1 );
619
627
foreach ($ attributes as $ key => $ val )
620
628
{
0 commit comments