File tree 3 files changed +6
-4
lines changed
files_sharing/lib/Controller
3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -740,7 +740,10 @@ public function createShare(
740
740
}
741
741
742
742
// If we have a label, use it
743
- if (!empty ($ label )) {
743
+ if ($ label !== '' ) {
744
+ if (strlen ($ label ) > 255 ) {
745
+ throw new OCSBadRequestException ('Maximum label length is 255 ' );
746
+ }
744
747
$ share ->setLabel ($ label );
745
748
}
746
749
Original file line number Diff line number Diff line change @@ -1008,7 +1008,7 @@ protected function createShareObject(array $data): IShare {
1008
1008
$ share ->setPassword ($ data ['password ' ]);
1009
1009
$ passwordExpirationTime = \DateTime::createFromFormat ('Y-m-d H:i:s ' , $ data ['password_expiration_time ' ] ?? '' );
1010
1010
$ share ->setPasswordExpirationTime ($ passwordExpirationTime !== false ? $ passwordExpirationTime : null );
1011
- $ share ->setLabel ($ data ['label ' ]);
1011
+ $ share ->setLabel ($ data ['label ' ] ?? '' );
1012
1012
$ share ->setSendPasswordByTalk ((bool )$ data ['password_by_talk ' ]);
1013
1013
$ share ->setHideDownload ((bool )$ data ['hide_download ' ]);
1014
1014
$ share ->setReminderSent ((bool )$ data ['reminder_sent ' ]);
Original file line number Diff line number Diff line change @@ -66,14 +66,13 @@ class Share implements IShare {
66
66
private $ shareTime ;
67
67
/** @var bool */
68
68
private $ mailSend ;
69
- /** @var string */
70
- private $ label = '' ;
71
69
/** @var ICacheEntry|null */
72
70
private $ nodeCacheEntry ;
73
71
/** @var bool */
74
72
private $ hideDownload = false ;
75
73
private bool $ reminderSent = false ;
76
74
75
+ private string $ label = '' ;
77
76
private bool $ noExpirationDate = false ;
78
77
79
78
public function __construct (
You can’t perform that action at this time.
0 commit comments