diff --git a/application/src/Stdlib/Oembed.php b/application/src/Stdlib/Oembed.php index f95319f8b..7d77298f3 100644 --- a/application/src/Stdlib/Oembed.php +++ b/application/src/Stdlib/Oembed.php @@ -88,7 +88,7 @@ public function renderOembed(PhpRenderer $view, array $oembed) if ('photo' === $type) { $url = $oembed['url'] ?? null; return sprintf( - '%s', + '%s', $view->escapeHtml($url), $view->escapeHtml($oembed['width'] ?? ''), $view->escapeHtml($oembed['height'] ?? ''), 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(); ?> -
+