mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Merge pull request #50448 from nextcloud/backport/50447/stable30
[stable30] fix: Ensure `label` is always a string
This commit is contained in:
commit
65e9059e65
3 changed files with 6 additions and 4 deletions
|
|
@ -733,7 +733,10 @@ class ShareAPIController extends OCSController {
|
|||
}
|
||||
|
||||
// If we have a label, use it
|
||||
if (!empty($label)) {
|
||||
if ($label !== '') {
|
||||
if (strlen($label) > 255) {
|
||||
throw new OCSBadRequestException('Maximum label length is 255');
|
||||
}
|
||||
$share->setLabel($label);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1005,7 +1005,7 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider
|
|||
$share->setPassword($data['password']);
|
||||
$passwordExpirationTime = \DateTime::createFromFormat('Y-m-d H:i:s', $data['password_expiration_time'] ?? '');
|
||||
$share->setPasswordExpirationTime($passwordExpirationTime !== false ? $passwordExpirationTime : null);
|
||||
$share->setLabel($data['label']);
|
||||
$share->setLabel($data['label'] ?? '');
|
||||
$share->setSendPasswordByTalk((bool)$data['password_by_talk']);
|
||||
$share->setHideDownload((bool)$data['hide_download']);
|
||||
|
||||
|
|
|
|||
|
|
@ -66,13 +66,12 @@ class Share implements IShare {
|
|||
private $shareTime;
|
||||
/** @var bool */
|
||||
private $mailSend;
|
||||
/** @var string */
|
||||
private $label = '';
|
||||
/** @var ICacheEntry|null */
|
||||
private $nodeCacheEntry;
|
||||
/** @var bool */
|
||||
private $hideDownload = false;
|
||||
|
||||
private string $label = '';
|
||||
private bool $noExpirationDate = false;
|
||||
|
||||
public function __construct(
|
||||
|
|
|
|||
Loading…
Reference in a new issue