File tree Expand file tree Collapse file tree
files_sharing/lib/Controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -740,7 +740,10 @@ public function createShare(
740740 }
741741
742742 // 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+ }
744747 $ share ->setLabel ($ label );
745748 }
746749
Original file line number Diff line number Diff line change @@ -1008,7 +1008,7 @@ protected function createShareObject(array $data): IShare {
10081008 $ share ->setPassword ($ data ['password ' ]);
10091009 $ passwordExpirationTime = \DateTime::createFromFormat ('Y-m-d H:i:s ' , $ data ['password_expiration_time ' ] ?? '' );
10101010 $ share ->setPasswordExpirationTime ($ passwordExpirationTime !== false ? $ passwordExpirationTime : null );
1011- $ share ->setLabel ($ data ['label ' ]);
1011+ $ share ->setLabel ($ data ['label ' ] ?? '' );
10121012 $ share ->setSendPasswordByTalk ((bool )$ data ['password_by_talk ' ]);
10131013 $ share ->setHideDownload ((bool )$ data ['hide_download ' ]);
10141014 $ share ->setReminderSent ((bool )$ data ['reminder_sent ' ]);
Original file line number Diff line number Diff line change @@ -66,14 +66,13 @@ class Share implements IShare {
6666 private $ shareTime ;
6767 /** @var bool */
6868 private $ mailSend ;
69- /** @var string */
70- private $ label = '' ;
7169 /** @var ICacheEntry|null */
7270 private $ nodeCacheEntry ;
7371 /** @var bool */
7472 private $ hideDownload = false ;
7573 private bool $ reminderSent = false ;
7674
75+ private string $ label = '' ;
7776 private bool $ noExpirationDate = false ;
7877
7978 public function __construct (
You can’t perform that action at this time.
0 commit comments