diff --git a/application/src/Media/Renderer/Youtube.php b/application/src/Media/Renderer/Youtube.php index df79ec8d3..00609e43a 100644 --- a/application/src/Media/Renderer/Youtube.php +++ b/application/src/Media/Renderer/Youtube.php @@ -36,7 +36,7 @@ public function render(PhpRenderer $view, MediaRepresentation $media, } $url->setQuery($query); $embed = sprintf( - '', + '', $view->escapeHtml($options['width']), $view->escapeHtml($options['height']), $view->escapeHtml($url), diff --git a/application/src/Stdlib/Oembed.php b/application/src/Stdlib/Oembed.php index f95319f8b..945689238 100644 --- a/application/src/Stdlib/Oembed.php +++ b/application/src/Stdlib/Oembed.php @@ -87,8 +87,9 @@ public function renderOembed(PhpRenderer $view, array $oembed) $type = $oembed['type'] ?? null; if ('photo' === $type) { $url = $oembed['url'] ?? null; + $data = $oembed['oembed'] ?? []; return sprintf( - '%s', + '%s', $view->escapeHtml($url), $view->escapeHtml($oembed['width'] ?? ''), $view->escapeHtml($oembed['height'] ?? ''), diff --git a/application/src/View/Helper/IiifViewer.php b/application/src/View/Helper/IiifViewer.php index cf65820fa..464e3002a 100644 --- a/application/src/View/Helper/IiifViewer.php +++ b/application/src/View/Helper/IiifViewer.php @@ -23,6 +23,6 @@ public function __invoke(array $query, array $options = []) $width = $options['width'] ?? '100%'; $height = $options['height'] ?? '700px'; $src = $view->url('iiif-viewer', [], ['force_canonical' => true, 'query' => $query]); - return sprintf('', $width, $height, $view->escapeHtml($src)); + return sprintf('', $width, $height, $view->escapeHtml($src)); } } diff --git a/application/src/View/Helper/Thumbnail.php b/application/src/View/Helper/Thumbnail.php index d4933bb63..54bec363f 100644 --- a/application/src/View/Helper/Thumbnail.php +++ b/application/src/View/Helper/Thumbnail.php @@ -31,6 +31,13 @@ public function __invoke(AbstractRepresentation $representation, $type, array $a $params = $triggerHelper('view_helper.thumbnail.attribs', $params, true); $attribs = $params['attribs']; + // Include element for lazy loading. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/loading + if (!isset($attribs['loading'])) { + // Due to a bug in firefox, the attribute "loading" should be set + // before src (see https://bugzilla.mozilla.org/show_bug.cgi?id=1647077). + $attribs = ['loading' => 'lazy'] + $attribs; + } + if (!isset($attribs['alt'])) { $attribs['alt'] = $representation->thumbnailAltText(); } diff --git a/application/view/common/asset-form.phtml b/application/view/common/asset-form.phtml index e81c62e0c..ee8df74ce 100644 --- a/application/view/common/asset-form.phtml +++ b/application/view/common/asset-form.phtml @@ -19,7 +19,7 @@ if ($assetId) {
%s
', + echo sprintf('%s
%s
', $this->escapeHtml($asset->assetUrl()), $this->escapeHtml($asset->altText()), $this->escapeHtml($asset->name()) @@ -28,7 +28,7 @@ if ($assetId) {
diff --git a/application/view/common/asset-options.phtml b/application/view/common/asset-options.phtml index 16f82a85f..1bc566bf3 100644 --- a/application/view/common/asset-options.phtml +++ b/application/view/common/asset-options.phtml @@ -9,7 +9,7 @@ $form->prepare(); $selectedAssetTemplate = '

' . $translate('No Asset') . '

- +
' . $translate('[No asset selected]') . ' diff --git a/application/view/omeka/site-admin/index/theme-selector.phtml b/application/view/omeka/site-admin/index/theme-selector.phtml index 95c3ee0ae..c490ee08c 100644 --- a/application/view/omeka/site-admin/index/theme-selector.phtml +++ b/application/view/omeka/site-admin/index/theme-selector.phtml @@ -28,7 +28,7 @@ $this->headScript()->appendFile($this->assetUrl('js/site-theme.js', 'Omeka')); getIni('omeka_version_constraint')); ?> -
+

escapeHtml($theme->getName()); ?>

diff --git a/application/view/omeka/site-admin/index/theme.phtml b/application/view/omeka/site-admin/index/theme.phtml index 1a4db8466..d893d2343 100644 --- a/application/view/omeka/site-admin/index/theme.phtml +++ b/application/view/omeka/site-admin/index/theme.phtml @@ -20,7 +20,7 @@ $fallbackThumbnailUrl = $this->assetUrl('img/theme.jpg', 'Omeka');
getThumbnail(); ?> basePath() . $currentTheme->getThumbnail(); ?> -
+