Escape album name select list in photo upload form

- Thanks to @apexrabbit for the report!
pull/14139/head
Hypolite Petovan 2024-05-09 20:57:35 -04:00
rodzic a6cb3ed903
commit 25475b4838
2 zmienionych plików z 12 dodań i 11 usunięć

Wyświetl plik

@ -672,18 +672,14 @@ function photos_content(App $a)
$selname = (!is_null($datum) && Strings::isHex($datum)) ? hex2bin($datum) : ''; $selname = (!is_null($datum) && Strings::isHex($datum)) ? hex2bin($datum) : '';
$albumselect = ''; $albumselect = ['' => '<current year>'];
$albumselect .= '<option value="" ' . (!$selname ? ' selected="selected" ' : '') . '>&lt;current year&gt;</option>'; foreach (Photo::getAlbums($owner_uid) as $album) {
$albums = Photo::getAlbums($owner_uid); if ($album['album'] === '') {
if (!empty($albums)) { continue;
foreach ($albums as $album) {
if ($album['album'] === '') {
continue;
}
$selected = (($selname === $album['album']) ? ' selected="selected" ' : '');
$albumselect .= '<option value="' . $album['album'] . '"' . $selected . '>' . $album['album'] . '</option>';
} }
$albumselect[$album['album']] = $album['album'];
} }
$uploader = ''; $uploader = '';
@ -729,6 +725,7 @@ function photos_content(App $a)
'$existalbumtext' => DI::l10n()->t('or select existing album:'), '$existalbumtext' => DI::l10n()->t('or select existing album:'),
'$nosharetext' => DI::l10n()->t('Do not show a status post for this upload'), '$nosharetext' => DI::l10n()->t('Do not show a status post for this upload'),
'$albumselect' => $albumselect, '$albumselect' => $albumselect,
'$selname' => $selname,
'$permissions' => DI::l10n()->t('Permissions'), '$permissions' => DI::l10n()->t('Permissions'),
'$aclselect' => $aclselect_e, '$aclselect' => $aclselect_e,
'$lockstate' => ACL::getLockstateForUserId($a->getLoggedInUserId()) ? 'lock' : 'unlock', '$lockstate' => ACL::getLockstateForUserId($a->getLoggedInUserId()) ? 'lock' : 'unlock',

Wyświetl plik

@ -9,7 +9,11 @@
<label id="photos-upload-text" for="photos-upload-newalbum">{{$newalbum}}</label> <label id="photos-upload-text" for="photos-upload-newalbum">{{$newalbum}}</label>
<input id="photos-upload-album-select" class="form-control" placeholder="{{$existalbumtext}}" list="dl-photo-upload" type="text" name="album" size="4"> <input id="photos-upload-album-select" class="form-control" placeholder="{{$existalbumtext}}" list="dl-photo-upload" type="text" name="album" size="4">
<datalist id="dl-photo-upload">{{$albumselect nofilter}}</datalist> <datalist id="dl-photo-upload">
{{foreach $albumselect as $value => $name}}
<option value="{{$value}}"{{if $selname == $value}} selected{{/if}}>{{$name}}</option>
{{/foreach}}
</datalist>
</div> </div>
<div id="photos-upload-end" class="clearfix"></div> <div id="photos-upload-end" class="clearfix"></div>