29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-16 09:02:52 +00:00

Merge branch '4.0-dev' of github.com:joomla/joomla-cms into HEAD

# Conflicts:
#	.drone.yml
#	administrator/language/en-GB/install.xml
#	administrator/language/en-GB/langmetadata.xml
#	administrator/manifests/files/joomla.xml
#	administrator/manifests/packages/pkg_en-GB.xml
#	api/components/com_categories/src/Controller/CategoriesController.php
#	api/language/en-GB/install.xml
#	api/language/en-GB/langmetadata.xml
#	composer.lock
#	installation/language/en-GB/langmetadata.xml
#	language/en-GB/install.xml
#	language/en-GB/langmetadata.xml
#	layouts/joomla/content/category_default.php
#	libraries/src/Application/ConsoleApplication.php
#	libraries/src/Version.php
#	tests/Codeception/acceptance/administrator/components/com_media/MediaListCest.php
This commit is contained in:
Benjamin Trenkle 2022-01-16 03:26:30 +01:00
commit 92d7cf3eb8
No known key found for this signature in database
GPG Key ID: F6BBF5456D4762FF
93 changed files with 530 additions and 328 deletions

View File

@ -182,19 +182,20 @@ steps:
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysql
- name: phpnext-api-mysql
depends_on:
- phpmin-api-mysql
image: joomlaprojects/docker-images:systemtests8.2
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpnext
# - name: phpnext-api-mysql
# depends_on:
# - phpmin-api-mysql
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpnext
- name: phpmin-api-postgres
depends_on:
- phpnext-api-mysql
# - phpnext-api-mysql
- phpmin-api-mysql
image: joomlaprojects/docker-images:systemtests
failure: ignore
environment:
@ -202,19 +203,20 @@ steps:
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgres
- name: phpnext-api-postgres
depends_on:
- phpmin-api-postgres
image: joomlaprojects/docker-images:systemtests8.2
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgresphpnext
# - name: phpnext-api-postgres
# depends_on:
# - phpmin-api-postgres
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-api-run.sh "$(pwd)" postgresphpnext
- name: phpmax-api-postgres
depends_on:
- phpnext-api-postgres
# - phpnext-api-postgres
- phpmin-api-postgres
image: joomlaprojects/docker-images:systemtests8.1
failure: ignore
environment:
@ -233,17 +235,20 @@ steps:
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" mysql
- name: phpnext-system-mysql
depends_on: [ phpmin-system-mysql ]
image: joomlaprojects/docker-images:systemtests8.2
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" mysqlphpnext
# - name: phpnext-system-mysql
# depends_on:
# - phpmin-system-mysql
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-system-run.sh "$(pwd)" mysqlphpnext
- name: phpmax-system-mysql
depends_on: [ phpnext-system-mysql ]
depends_on:
# - phpnext-system-mysql
- phpmin-system-mysql
image: joomlaprojects/docker-images:systemtests8.1
failure: ignore
environment:
@ -251,17 +256,20 @@ steps:
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" mysqlphpmax
- name: phpnext-system-mysql8
depends_on: [ phpmax-system-mysql ]
image: joomlaprojects/docker-images:systemtests8.2
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" mysql8phpnext
# - name: phpnext-system-mysql8
# depends_on:
# - phpmax-system-mysql
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-system-run.sh "$(pwd)" mysql8phpnext
- name: phpmax-system-mysql8
depends_on: [ phpnext-system-mysql ]
depends_on:
# - phpnext-system-mysql
- phpmax-system-mysql
image: joomlaprojects/docker-images:systemtests8.1
failure: ignore
environment:
@ -269,17 +277,20 @@ steps:
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" mysql8phpmax
- name: phpnext-system-postgres
depends_on: [ phpmax-system-mysql8 ]
image: joomlaprojects/docker-images:systemtests8.2
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" postgresphpnext
# - name: phpnext-system-postgres
# depends_on:
# - phpmax-system-mysql8
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-system-run.sh "$(pwd)" postgresphpnext
- name: phpmax-system-postgres
depends_on: [ phpnext-system-mysql8 ]
depends_on:
# - phpnext-system-mysql8
- phpmax-system-mysql8
image: joomlaprojects/docker-images:systemtests8.1
failure: ignore
environment:
@ -306,17 +317,17 @@ steps:
- name: artifacts-system-tests
image: cschlosser/drone-ftps
depends_on:
- phpnext-system-mysql
- phpnext-system-mysql8
- phpnext-system-postgres
# - phpnext-system-mysql
# - phpnext-system-mysql8
# - phpnext-system-postgres
- phpmax-system-mysql
- phpmax-system-mysql8
- phpmax-system-postgres
- phpmin-system-mysql
- phpmin-system-mysql8
- phpmin-system-postgres
- phpnext-api-mysql
- phpnext-api-postgres
# - phpnext-api-mysql
# - phpnext-api-postgres
- phpmax-api-mysql
- phpmax-api-postgres
- phpmin-api-mysql
@ -409,6 +420,6 @@ steps:
---
kind: signature
hmac: e93522732dd8607448fa7705982c42c06f9ebf9762023ed1bb2207ee975fee42
hmac: daa8e5588cc88058bc57aadf35e3d9dd55eefaa9419c457ce374a0dd19eb7cda
...

View File

@ -416,7 +416,7 @@ class ArticleModel extends AdminModel implements WorkflowModelInterface
$registry = new Registry($item->urls);
$item->urls = $registry->toArray();
$item->articletext = trim($item->fulltext) != '' ? $item->introtext . "<hr id=\"system-readmore\">" . $item->fulltext : $item->introtext;
$item->articletext = ($item->fulltext !== null && trim($item->fulltext) != '') ? $item->introtext . "<hr id=\"system-readmore\">" . $item->fulltext : $item->introtext;
if (!empty($item->id))
{

View File

@ -56,7 +56,7 @@ class HtmlView extends BaseHtmlView
public function display($tpl = null)
{
$app = Factory::getApplication();
$dashboard = $app->input->getCmd('dashboard');
$dashboard = $app->input->getCmd('dashboard', '');
$position = ApplicationHelper::stringURLSafe($dashboard);

View File

@ -525,7 +525,7 @@ class ZIPExtraction
return;
}
$sleepMillisec = $minExecTime - $elapsed;
$sleepMillisec = intval($minExecTime - $elapsed);
/**
* If we need to sleep for more than 1 second we should be using sleep() or time_sleep_until() to prevent high

View File

@ -296,6 +296,12 @@ class HtmlView extends BaseHtmlView
*/
public function shouldDisplayPreUpdateCheck()
{
// When the download URL is not found there is no core upgrade path
if (!isset($this->updateInfo['object']->downloadurl->_data))
{
return false;
}
$nextMinor = Version::MAJOR_VERSION . '.' . (Version::MINOR_VERSION + 1);
// Show only when we found a download URL, we have an update and when we update to the next minor or greater.

View File

@ -55,6 +55,32 @@ class ProviderManager
$this->providers[$provider->getID()] = $provider;
}
/**
* Unregister a provider from the ProviderManager.
* When no provider, or null is passed in, then all providers are cleared.
*
* @param ProviderInterface|null $provider The provider to be unregistered
*
* @return void
*
* @since 4.0.6
*/
public function unregisterProvider(ProviderInterface $provider = null): void
{
if ($provider === null)
{
$this->providers = [];
return;
}
if (!array_key_exists($provider->getID(), $this->providers))
{
return;
}
unset($this->providers[$provider->getID()]);
}
/**
* Returns the provider for a particular ID
*

View File

@ -121,7 +121,7 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLAGAIN="Reinstall Joomla core files"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLED="Installed Joomla version"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLUPDATE="Update"
COM_JOOMLAUPDATE_VIEW_DEFAULT_LATEST="Latest Joomla version"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL="We can't find a download URL"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL="Update unavailable"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL_DESC="An update to Joomla %1$s was found, but it wasn't possible to fetch the download URL for that update. Either the update to Joomla %1$s is not available for your stability level or there is a problem with the Joomla Update Server.<br>Please try to download the update package from <a href=\"https://downloads.joomla.org/latest\">the official Joomla download page</a> and use the Upload and Update tab."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE="A new version of the Joomla Update Component is available."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE_DESC="You must update this component first before you can update Joomla! <a class=\"alert-link\" href=\"index.php?option=com_installer&view=update\">Click here to update the component</a>."

View File

@ -649,6 +649,10 @@ JLIB_INSTALLER_NOT_ERROR="If the error is related to the installation of TinyMCE
JLIB_INSTALLER_NOTICE_LANG_RESET_USERS="Language set to Default for %d users."
JLIB_INSTALLER_NOTICE_LANG_RESET_USERS_1="Language set to Default for the user."
JLIB_INSTALLER_PURGED_UPDATES="Cleared updates."
JLIB_INSTALLER_SQL_BEGIN="Start of SQL updates."
JLIB_INSTALLER_SQL_BEGIN_SCHEMA="The current database version (schema) is %s."
JLIB_INSTALLER_SQL_END="End of SQL updates."
JLIB_INSTALLER_SQL_END_NOT_COMPLETE="End of SQL updates - INCOMPLETE."
JLIB_INSTALLER_UNINSTALL="Uninstall"
JLIB_INSTALLER_UPDATE="Update"
JLIB_INSTALLER_UPDATE_LOG_QUERY="Ran query from file %1$s. Query text: %2$s."

View File

@ -96,7 +96,8 @@ abstract class LatestHelper
{
$item->link = '';
if ($user->authorise('core.edit', 'com_content.article.' . $item->id))
if ($user->authorise('core.edit', 'com_content.article.' . $item->id)
|| ($user->authorise('core.edit.own', 'com_content.article.' . $item->id) && ($userId === $item->created_by)))
{
$item->link = Route::_('index.php?option=com_content&task=article.edit&id=' . $item->id);
}

View File

@ -87,7 +87,8 @@ abstract class PopularHelper
{
$item->link = '';
if ($user->authorise('core.edit', 'com_content.article.' . $item->id))
if ($user->authorise('core.edit', 'com_content.article.' . $item->id)
|| ($user->authorise('core.edit.own', 'com_content.article.' . $item->id) && ($userId === $item->created_by)))
{
$item->link = Route::_('index.php?option=com_content&task=article.edit&id=' . $item->id);
}

View File

@ -51,7 +51,7 @@ class CategoriesController extends ApiController
$extension = $this->getExtensionFromInput();
$data['extension'] = $extension;
// @todo: This is a hack to drop the extension into the global input object - to satisfy how state is built
// TODO: This is a hack to drop the extension into the global input object - to satisfy how state is built
// we should be able to improve this in the future
$this->input->set('extension', $extension);
@ -65,7 +65,7 @@ class CategoriesController extends ApiController
*
* @return integer The record ID on success, false on failure
*
* @since 4.1.0
* @since 4.0.6
*/
protected function save($recordKey = null)
{

View File

@ -61,6 +61,7 @@ class StubGenerator extends CliApplication
public function doExecute()
{
$this->createExtensionNamespaceMap();
$contentsByNamespace = [];
$file = "<?php\n";
@ -77,18 +78,36 @@ class StubGenerator extends CliApplication
$modifier = (!$reflection->isInterface() && $reflection->isFinal()) ? 'final ' : '';
$modifier = ($reflection->isAbstract() && !$reflection->isInterface()) ? $modifier . 'abstract ' : $modifier;
$namespaceSegments = explode('\\', $oldName);
$className = array_pop($namespaceSegments);
$targetNamespace = ltrim(implode('\\', $namespaceSegments), '\\');
// If a deprecated version is available, write a stub class doc block with a deprecated tag
if ($deprecatedVersion !== false)
{
$file .= <<<PHP
/**
* @deprecated $deprecatedVersion Use $newName instead.
*/
$fileContents = <<<PHP
/**
* @deprecated $deprecatedVersion Use $newName instead.
*/
PHP;
}
$file .= "$modifier$type $oldName extends $newName {}\n\n";
$fileContents .= "\t$modifier$type $className extends \\$newName {}\n\n";
if (!array_key_exists($targetNamespace, $contentsByNamespace))
{
$contentsByNamespace[$targetNamespace] = '';
}
$contentsByNamespace[$targetNamespace] .= $fileContents;
}
foreach ($contentsByNamespace as $namespace => $contents)
{
$file .= "namespace $namespace {\n";
$file .= $contents;
$file .= "}\n\n";
}
// And save the file locally

View File

@ -12,6 +12,7 @@ defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\Contact\Administrator\Helper\ContactHelper;
@ -99,7 +100,14 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<a href="<?php echo Route::_(RouteHelper::getContactRoute($item->slug, $item->catid, $item->language)); ?>">
<?php if ($this->params->get('show_image_heading')) : ?>
<?php if ($item->image) : ?>
<?php echo HTMLHelper::_('image', $item->image, '', array('class' => 'contact-thumbnail img-thumbnail')); ?>
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $item->image,
'alt' => '',
'class' => 'contact-thumbnail img-thumbnail',
]
); ?>
<?php endif; ?>
<?php endif; ?>
<?php echo $this->escape($item->name); ?>

View File

@ -14,6 +14,7 @@ use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Contact\Site\Helper\RouteHelper;
@ -97,11 +98,13 @@ $htag = $tparams->get('show_page_heading') ? 'h2' : 'h1';
<?php if ($this->item->image && $tparams->get('show_image')) : ?>
<div class="com-contact__thumbnail thumbnail">
<?php echo HTMLHelper::_(
'image',
$this->item->image,
htmlspecialchars($this->item->name, ENT_QUOTES, 'UTF-8'),
array('itemprop' => 'image')
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $this->item->image,
'alt' => $this->item->name,
'itemprop' => 'image',
]
); ?>
</div>
<?php endif; ?>

View File

@ -13,6 +13,7 @@ use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Layout\LayoutHelper;
$app = Factory::getApplication();
@ -54,8 +55,13 @@ $htag = $this->params->get('show_page_heading') ? 'h2' : 'h1';
<?php if ($beforeDisplayContent || $afterDisplayContent || $this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
<div class="category-desc clearfix">
<?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
<?php $alt = empty($this->category->getParams()->get('image_alt')) && empty($this->category->getParams()->get('image_alt_empty')) ? '' : 'alt="' . htmlspecialchars($this->category->getParams()->get('image_alt'), ENT_COMPAT, 'UTF-8') . '"'; ?>
<img src="<?php echo $this->category->getParams()->get('image'); ?>" <?php echo $alt; ?>>
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $this->category->getParams()->get('image'),
'alt' => empty($this->category->getParams()->get('image_alt')) && empty($this->category->getParams()->get('image_alt_empty')) ? false : $this->category->getParams()->get('image_alt'),
]
); ?>
<?php endif; ?>
<?php echo $beforeDisplayContent; ?>
<?php if ($this->params->get('show_description') && $this->category->description) : ?>
@ -78,12 +84,11 @@ $htag = $this->params->get('show_page_heading') ? 'h2' : 'h1';
<?php if (!empty($this->lead_items)) : ?>
<div class="com-content-category-blog__items blog-items items-leading <?php echo $this->params->get('blog_class_leading'); ?>">
<?php foreach ($this->lead_items as &$item) : ?>
<div class="com-content-category-blog__item blog-item"
itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<?php
$this->item = & $item;
echo $this->loadTemplate('item');
?>
<div class="com-content-category-blog__item blog-item" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</div>
<?php $leadingcount++; ?>
<?php endforeach; ?>

View File

@ -12,9 +12,9 @@ defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Layout\LayoutHelper;
$pageClass = $this->params->get('pageclass_sfx');
$htag = $this->params->get('show_page_heading') ? 'h2' : 'h1';
$htag = $this->params->get('show_page_heading') ? 'h2' : 'h1';
?>
<div class="com-newsfeeds-category newsfeed-category">
<?php if ($this->params->get('show_page_heading')) : ?>
@ -34,7 +34,13 @@ $htag = $this->params->get('show_page_heading') ? 'h2' : 'h1';
<?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
<div class="com-newsfeeds-category__description category-desc">
<?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
<img src="<?php echo $this->category->getParams()->get('image'); ?>">
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $this->category->getParams()->get('image'),
'alt' => empty($this->category->getParams()->get('image_alt')) && empty($this->category->getParams()->get('image_alt_empty')) ? false : $this->category->getParams()->get('image_alt'),
]
); ?>
<?php endif; ?>
<?php if ($this->params->get('show_description') && $this->category->description) : ?>
<?php echo HTMLHelper::_('content.prepare', $this->category->description, '', 'com_newsfeeds.category'); ?>

View File

@ -14,6 +14,7 @@ use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Layout\LayoutHelper;
?>
@ -61,30 +62,37 @@ use Joomla\CMS\Layout\FileLayout;
<!-- Show Images from Component -->
<?php if (isset($images->image_first) && !empty($images->image_first)) : ?>
<?php $imgfloat = empty($images->float_first) ? $this->params->get('float_first') : $images->float_first; ?>
<?php $alt = empty($images->image_first_alt) && empty($images->image_first_alt_empty)
? ''
: 'alt="' . htmlspecialchars($images->image_first_alt, ENT_COMPAT, 'UTF-8') . '"'; ?>
<div class="com-newsfeeds-newsfeed__first-image img-intro-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?>">
<img
<?php if ($images->image_first_caption) : ?>
<?php echo 'class="caption" title="' . htmlspecialchars($images->image_first_caption, ENT_COMPAT, 'UTF-8') . '"'; ?>
<?php endif; ?>
src="<?php echo htmlspecialchars($images->image_first, ENT_COMPAT, 'UTF-8'); ?>" <?php echo $alt; ?>>
<div class="com-newsfeeds-newsfeed__first-image img-intro-<?php echo $this->escape($imgfloat); ?>">
<figure>
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $images->image_first,
'alt' => empty($images->image_first_alt) && empty($images->image_first_alt_empty) ? false : $images->image_first_alt,
]
); ?>
<?php if ($images->image_first_caption) : ?>
<figcaption class="caption"><?php echo $this->escape($images->image_first_caption); ?></figcaption>
<?php endif; ?>
</figure>
</div>
<?php endif; ?>
<?php if (isset($images->image_second) and !empty($images->image_second)) : ?>
<?php $imgfloat = empty($images->float_second) ? $this->params->get('float_second') : $images->float_second; ?>
<?php $alt = empty($images->image_second_alt) && empty($images->image_second_alt_empty)
? ''
: 'alt="' . htmlspecialchars($images->image_second_alt, ENT_COMPAT, 'UTF-8') . '"'; ?>
<div class="com-newsfeeds-newsfeed__second-image float-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?> item-image">
<img
<?php if ($images->image_second_caption) : ?>
<?php echo 'class="caption" title="' . htmlspecialchars($images->image_second_caption) . '"'; ?>
<?php endif; ?>
src="<?php echo htmlspecialchars($images->image_second, ENT_COMPAT, 'UTF-8'); ?>" <?php echo $alt; ?>>
<div class="com-newsfeeds-newsfeed__second-image float-<?php echo $this->escape($imgfloat); ?> item-image">
<figure>
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $images->image_second,
'alt' => empty($images->image_second_alt) && empty($images->image_second_alt_empty) ? false : $images->image_second_alt,
]
); ?>
<?php if ($images->image_second_caption) : ?>
<figcaption class="caption"><?php echo $this->escape($images->image_second_caption); ?></figcaption>
<?php endif; ?>
</figure>
</div>
<?php endif; ?>
<!-- Show Description from Component -->
@ -98,9 +106,15 @@ use Joomla\CMS\Layout\FileLayout;
<?php endif; ?>
<!-- Show Image -->
<?php if ($this->rssDoc->image && $this->params->get('show_feed_image')) : ?>
<?php if ($this->rssDoc->image && $this->params->get('show_feed_image')) : ?>
<div class="com-newsfeeds-newsfeed__feed-image">
<img src="<?php echo $this->rssDoc->image->uri; ?>" alt="<?php echo $this->rssDoc->image->title; ?>" />
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $this->rssDoc->image->uri,
'alt' => $this->rssDoc->image->title,
]
); ?>
</div>
<?php endif; ?>

View File

@ -1,16 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset name="default" label="COM_PRIVACY_CONFIRM_REQUEST_FIELDSET_LABEL">
<field
name="email"
type="text"
label="JGLOBAL_EMAIL"
description="COM_PRIVACY_FIELD_CONFIRM_EMAIL_DESC"
validate="email"
required="true"
size="30"
/>
<field
name="confirm_token"
type="text"

View File

@ -1,16 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset name="default">
<field
name="email"
type="email"
label="JGLOBAL_EMAIL"
description="COM_PRIVACY_FIELD_CONFIRM_EMAIL_DESC"
validate="email"
required="true"
size="30"
/>
<field
name="request_type"
type="list"

View File

@ -11,7 +11,6 @@ namespace Joomla\Component\Privacy\Site\Controller;
\defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Router\Route;
@ -36,11 +35,11 @@ class DisplayController extends BaseController
{
$view = $this->input->get('view', $this->default_view);
// Submitting information requests through the frontend is restricted to authenticated users at this time
if ($view === 'request' && $this->app->getIdentity()->guest)
// Submitting information requests and confirmation through the frontend is restricted to authenticated users at this time
if (in_array($view, ['confirm', 'request']) && $this->app->getIdentity()->guest)
{
$this->setRedirect(
Route::_('index.php?option=com_users&view=login&return=' . base64_encode('index.php?option=com_privacy&view=request'), false)
Route::_('index.php?option=com_users&view=login&return=' . base64_encode('index.php?option=com_privacy&view=' . $view), false)
);
return $this;
@ -49,7 +48,7 @@ class DisplayController extends BaseController
// Set a Referrer-Policy header for views which require it
if (in_array($view, ['confirm', 'remind']))
{
Factory::getApplication()->setHeader('Referrer-Policy', 'no-referrer', true);
$this->app->setHeader('Referrer-Policy', 'no-referrer', true);
}
return parent::display($cachable, $urlparams);

View File

@ -44,7 +44,6 @@ class ConfirmModel extends AdminModel
{
// Get the form.
$form = $this->getForm();
$data['email'] = PunycodeHelper::emailToPunycode($data['email']);
// Check for an error.
if ($form instanceof \Exception)
@ -74,11 +73,14 @@ class ConfirmModel extends AdminModel
return false;
}
// Get the user email address
$email = Factory::getUser()->email;
// Search for the information request
/** @var RequestTable $table */
$table = $this->getTable();
if (!$table->load(['email' => $data['email'], 'status' => 0]))
if (!$table->load(['email' => $email, 'status' => 0]))
{
$this->setError(Text::_('COM_PRIVACY_ERROR_NO_PENDING_REQUESTS'));

View File

@ -58,8 +58,7 @@ class RequestModel extends AdminModel
}
// Get the form.
$form = $this->getForm();
$data['email'] = PunycodeHelper::emailToPunycode($data['email']);
$form = $this->getForm();
// Check for an error.
if ($form instanceof \Exception)
@ -89,6 +88,8 @@ class RequestModel extends AdminModel
return false;
}
$email = Factory::getUser()->email;
// Search for an open information request matching the email and type
$db = $this->getDbo();
$query = $db->getQuery(true)
@ -97,7 +98,7 @@ class RequestModel extends AdminModel
->where($db->quoteName('email') . ' = :email')
->where($db->quoteName('request_type') . ' = :requesttype')
->whereIn($db->quoteName('status'), [0, 1])
->bind(':email', $data['email'])
->bind(':email', $email)
->bind(':requesttype', $data['request_type']);
try
@ -138,7 +139,7 @@ class RequestModel extends AdminModel
$messageModel->notifySuperUsers(
Text::_('COM_PRIVACY_ADMIN_NOTIFICATION_USER_CREATED_REQUEST_SUBJECT'),
Text::sprintf('COM_PRIVACY_ADMIN_NOTIFICATION_USER_CREATED_REQUEST_MESSAGE', $data['email'])
Text::sprintf('COM_PRIVACY_ADMIN_NOTIFICATION_USER_CREATED_REQUEST_MESSAGE', $email)
);
// The mailer can be set to either throw Exceptions or return boolean false, account for both
@ -173,7 +174,7 @@ class RequestModel extends AdminModel
}
$mailer->addTemplateData($templateData);
$mailer->addRecipient($data['email']);
$mailer->addRecipient($email);
$mailer->send();

View File

@ -14,7 +14,10 @@
"php": "7.2.5"
},
"vendor-dir": "libraries/vendor",
"github-protocols": ["https"]
"github-protocols": ["https"],
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"support": {
"issues": "https://issues.joomla.org/",
@ -22,6 +25,13 @@
"forum": "https://forum.joomla.org/",
"docs": "https://docs.joomla.org/"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/joomla-backports/json-api-php.git",
"no-api": true
}
],
"autoload": {
"psr-4": {
"Joomla\\CMS\\": "libraries/src/"
@ -62,7 +72,7 @@
"fig/link-util": "~1.0",
"google/recaptcha": "~1.1",
"laminas/laminas-diactoros": "^2.2.2",
"paragonie/sodium_compat": "~1.9.1",
"paragonie/sodium_compat": "~1.17.0",
"phpmailer/phpmailer": "~6.0",
"psr/link": "~1.0",
"symfony/console": "~5.0",
@ -75,7 +85,7 @@
"typo3/phar-stream-wrapper": "~3.1",
"wamania/php-stemmer": "^2.0",
"maximebf/debugbar": "^1.17",
"tobscure/json-api": "^0.4.1",
"tobscure/json-api": "dev-joomla-backports",
"willdurand/negotiation": "^3.0",
"ext-json": "*",
"ext-simplexml": "*",

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Arabic (اللغة العربية)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Dr. Ashraf Damra</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Czech (Čeština)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Czech Translation Team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Welsh (United Kingdom)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Joomla! Project - Welsh Translation Team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Danish (Danmark)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Danish Translation Team (Transl.: Ronny Buelund)</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Greek (el-GR)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Ομάδα Μετάφρασης στα Ελληνικά: joomla. gr</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>English (Australia)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Joomla! Project</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>English (United States)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Joomla! Project</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Spanish (Spain)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Spanish [es-ES] Translation Team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Estonian</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Joomla! Project</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Basque</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Joomla! Basque Translation Team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Persian (پارسی)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>JoomlaFarsi.Com Team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>French (fr-FR)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Joomla! Project - French translation team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Hungarian (Magyar)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Joomla! Magyarország</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Italiano (it-IT)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Italian Translation Team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Japanese (ja-JP)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Joomla!じゃぱん</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Georgian (Georgia)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Georgian Translation Team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Latvian (Latvia)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Joomla! Projekts</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Dutch (Belgium)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Dutch (BE) translation team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Dutch (nl-NL)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Dutch Translation Team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Polish (Poland)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Projekt Joomla!</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Português Brasil (pt-BR)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Projeto Joomla!</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Português (Portugal)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Comunidade JoomlaPortugal</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Română (România)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Horia Negura - Quanta</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Russian (Russia)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Russian Translation Team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Slovak (Slovakia)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Slovak translation team : Peter Michnica</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Slovenščina (Slovenija)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Slovenska prevajalska ekipa</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Swedish (Sweden)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Swedish Translation Team - SvenskJoomla</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -234,7 +234,7 @@ JLIB_INSTALLER_INSTALL="நிறுவுக"
JLIB_INSTALLER_NOT_ERROR="பிழையானது TinyMCE மொழிக் கோப்புகள் நிறுவல் தொடர்பானது என்றால் இப்பிழை Joomla! மொழி(கள்) நிறுவலுக்கு எந்த விளைவையும் ஏற்படுத்தாது. Joomla 3.2.0-க்கு முன் உருவாக்கப்பட்ட சில மொழித் தொகுப்புகள் TinyMCE மொழிக் கோப்புகளைத் தனியாக நிறுவ முயற்சிக்கலாம். இந்த TinyMCE மொழிக் கோப்புகள் தற்சமயம் Joomla-வில் சேர்க்கப்பட்டிருப்பதால் இவற்றைத் தனியாக நிறுவ வேண்டாம்."
JLIB_INSTALLER_WARNING_UNABLE_TO_INSTALL_CONTENT_LANGUAGE="%s மொழிக்கு உள்ளடக்க மொழியை (content language) உருவாக்க முடியவில்லை: %s."
JLIB_UPDATER_ERROR_OPEN_UPDATE_SITE="புதுப்பித்தல்: புதுப்பித்தல் தளத்தைத் திறக்க முடியவில்லை #%d \"%s\", இணையமுகவரி: %s"
JLIB_UTIL_ERROR_CONNECT_DATABASE="JDatabase: :getInstance: தரவுத்தளத்துடன் தொடர்பு கொள்ள முடியவில்லை <br>joomla.library: %1$s - %2$s"
JLIB_UTIL_ERROR_CONNECT_DATABASE="JDatabase: :getInstance: தரவுத்தளத்துடன் தொடர்பு கொள்ள முடியவில்லை<br>joomla.library: %1$s - %2$s"
; Strings for the language debugger
JDEBUG_LANGUAGE_FILES_IN_ERROR="மொழிக் கோப்புகளில் அலகிடல்/சொல்லிலக்கணப் பிழைகள்"
JDEBUG_LANGUAGE_UNTRANSLATED_STRING="மொழிபெயர்க்கப்படாத எழுத்துச்சரங்கள்"

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Tamil (India)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Ilagnayeru 'MIG' Manickam, Elango Samy Manim</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Thai (ภาษาไทย)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Thai Translation Team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Turkish (Turkey)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Joomla! Turkey</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>Ukrainian (uk-UA)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Joomla! Project - Ukrainian translation team</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>简体中文(中国)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>逐浪中文网 joomlachina.org.cn 周永建</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile client="installation">
<name>正體中文 (臺灣)</name>
<version>4.0.5</version>
<creationDate>December 2021</creationDate>
<version>4.0.6</version>
<creationDate>January 2022</creationDate>
<author>Joomla! 專案</author>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

View File

@ -300,13 +300,13 @@ final class InstallationApplication extends CMSApplication
*/
private function executeController()
{
$task = $this->input->get('task');
$task = $this->input->getCmd('task', '');
// The name of the controller
$controllerName = 'display';
// Parse task in format controller.task
if ($task)
if ($task !== '')
{
list($controllerName, $task) = explode('.', $task, 2);
}

View File

@ -648,6 +648,10 @@ JLIB_INSTALLER_NOT_ERROR="If the error is related to the installation of TinyMCE
JLIB_INSTALLER_NOTICE_LANG_RESET_USERS="Language set to Default for %d users."
JLIB_INSTALLER_NOTICE_LANG_RESET_USERS_1="Language set to Default for the user."
JLIB_INSTALLER_PURGED_UPDATES="Cleared updates."
JLIB_INSTALLER_SQL_BEGIN="Start of SQL updates."
JLIB_INSTALLER_SQL_BEGIN_SCHEMA="The current database version (schema) is %s."
JLIB_INSTALLER_SQL_END="End of SQL updates."
JLIB_INSTALLER_SQL_END_NOT_COMPLETE="End of SQL updates - INCOMPLETE."
JLIB_INSTALLER_UNINSTALL="Uninstall"
JLIB_INSTALLER_UPDATE="Update"
JLIB_INSTALLER_UPDATE_LOG_QUERY="Ran query from file %1$s. Query text: %2$s."

View File

@ -72,8 +72,13 @@ $tagsData = $category->tags->itemTags;
<?php if ($beforeDisplayContent || $afterDisplayContent || $params->get('show_description', 1) || $params->def('show_description_image', 1)) : ?>
<div class="category-desc">
<?php if ($params->get('show_description_image') && $category->getParams()->get('image')) : ?>
<?php $alt = empty($category->getParams()->get('image_alt')) && empty($category->getParams()->get('image_alt_empty')) ? '' : 'alt="' . htmlspecialchars($category->getParams()->get('image_alt'), ENT_COMPAT, 'UTF-8') . '"'; ?>
<img src="<?php echo $category->getParams()->get('image'); ?>" <?php echo $alt; ?>>
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $category->getParams()->get('image'),
'alt' => empty($category->getParams()->get('image_alt')) && empty($category->getParams()->get('image_alt_empty')) ? false : $category->getParams()->get('image_alt'),
]
); ?>
<?php endif; ?>
<?php echo $beforeDisplayContent; ?>
<?php if ($params->get('show_description') && $category->description) : ?>

View File

@ -9,8 +9,7 @@
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Layout\LayoutHelper;
$params = $displayData->params;
$images = json_decode($displayData->images);
@ -20,25 +19,16 @@ if (empty($images->image_fulltext))
return;
}
$imgclass = empty($images->float_fulltext) ? $params->get('float_fulltext') : $images->float_fulltext;
$extraAttr = '';
$img = HTMLHelper::cleanImageURL($images->image_fulltext);
$alt = empty($images->image_fulltext_alt) && empty($images->image_fulltext_alt_empty) ? '' : 'alt="' . htmlspecialchars($images->image_fulltext_alt, ENT_COMPAT, 'UTF-8') . '"';
// Set lazyloading only for images which have width and height attributes
if ((isset($img->attributes['width']) && (int) $img->attributes['width'] > 0)
&& (isset($img->attributes['height']) && (int) $img->attributes['height'] > 0))
{
$extraAttr = ArrayHelper::toString($img->attributes) . ' loading="lazy"';
}
$imgclass = empty($images->float_fulltext) ? $params->get('float_fulltext') : $images->float_fulltext;
$layoutAttr = [
'src' => $images->image_fulltext,
'itemprop' => 'image',
'alt' => empty($images->image_fulltext_alt) && empty($images->image_fulltext_alt_empty) ? false : $images->image_fulltext_alt,
];
?>
<figure class="<?php echo htmlspecialchars($imgclass, ENT_COMPAT, 'UTF-8'); ?> item-image">
<img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>"
<?php echo $alt; ?>
itemprop="image"
<?php echo $extraAttr; ?>
/>
<figure class="<?php echo $this->escape($imgclass); ?> item-image">
<?php echo LayoutHelper::render('joomla.html.image', $layoutAttr); ?>
<?php if ($images->image_fulltext_caption !== '') : ?>
<figcaption class="caption"><?php echo htmlspecialchars($images->image_fulltext_caption, ENT_COMPAT, 'UTF-8'); ?></figcaption>
<figcaption class="caption"><?php echo $this->escape($images->image_fulltext_caption); ?></figcaption>
<?php endif; ?>
</figure>

View File

@ -9,10 +9,9 @@
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;
use Joomla\Utilities\ArrayHelper;
$params = $displayData->params;
$images = json_decode($displayData->images);
@ -22,36 +21,21 @@ if (empty($images->image_intro))
return;
}
$imgclass = empty($images->float_intro) ? $params->get('float_intro') : $images->float_intro;
$extraAttr = '';
$img = HTMLHelper::cleanImageURL($images->image_intro);
$alt = empty($images->image_intro_alt) && empty($images->image_intro_alt_empty) ? '' : 'alt="' . htmlspecialchars($images->image_intro_alt, ENT_COMPAT, 'UTF-8') . '"';
// Set lazyloading only for images which have width and height attributes
if ((isset($img->attributes['width']) && (int) $img->attributes['width'] > 0)
&& (isset($img->attributes['height']) && (int) $img->attributes['height'] > 0))
{
$extraAttr = ArrayHelper::toString($img->attributes) . ' loading="lazy"';
}
$imgclass = empty($images->float_intro) ? $params->get('float_intro') : $images->float_intro;
$layoutAttr = [
'src' => $images->image_intro,
'alt' => empty($images->image_intro_alt) && empty($images->image_intro_alt_empty) ? false : $images->image_intro_alt,
];
?>
<figure class="<?php echo htmlspecialchars($imgclass, ENT_COMPAT, 'UTF-8'); ?> item-image">
<figure class="<?php echo $this->escape($imgclass); ?> item-image">
<?php if ($params->get('link_intro_image') && ($params->get('access-view') || $params->get('show_noauth', '0') == '1')) : ?>
<a href="<?php echo Route::_(RouteHelper::getArticleRoute($displayData->slug, $displayData->catid, $displayData->language)); ?>"
itemprop="url" title="<?php echo $this->escape($displayData->title); ?>">
<img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>"
<?php echo $alt; ?>
itemprop="thumbnailUrl"
<?php echo $extraAttr; ?>
/>
<a href="<?php echo Route::_(RouteHelper::getArticleRoute($displayData->slug, $displayData->catid, $displayData->language)); ?>" itemprop="url" title="<?php echo $this->escape($displayData->title); ?>">
<?php echo LayoutHelper::render('joomla.html.image', array_merge($layoutAttr, ['itemprop' => 'thumbnailUrl'])); ?>
</a>
<?php else : ?>
<img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>"
<?php echo $alt; ?>
itemprop="thumbnail"
<?php echo $extraAttr; ?>
/>
<?php echo LayoutHelper::render('joomla.html.image', array_merge($layoutAttr, ['itemprop' => 'thumbnail'])); ?>
<?php endif; ?>
<?php if (isset($images->image_intro_caption) && $images->image_intro_caption !== '') : ?>
<figcaption class="caption"><?php echo htmlspecialchars($images->image_intro_caption, ENT_COMPAT, 'UTF-8'); ?></figcaption>
<figcaption class="caption"><?php echo $this->escape($images->image_intro_caption); ?></figcaption>
<?php endif; ?>
</figure>

View File

@ -62,6 +62,12 @@ $attributes = array(
$required ? ' required' : '',
$dataAttribute,
);
// @deprecated 5.0 The unicode conversion of the URL will be moved to \Joomla\CMS\Form\Field\UrlField::getLayoutData
if ($value !== null)
{
$value = $this->escape(PunycodeHelper::urlToUTF8($value));
}
?>
<input
<?php echo $inputType; ?>
@ -69,5 +75,5 @@ $attributes = array(
name="<?php echo $name; ?>"
<?php echo !empty($class) ? ' class="form-control ' . $class . '"' : 'class="form-control"'; ?>
id="<?php echo $id; ?>"
value="<?php echo htmlspecialchars(PunycodeHelper::urlToUTF8($value), ENT_COMPAT, 'UTF-8'); ?>"
value="<?php echo $value; ?>"
<?php echo implode(' ', $attributes); ?>>

View File

@ -0,0 +1,49 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* Layout variables
* -----------------
* @var array $displayData Array with all the given attributes for the image element.
* Eg: src, class, alt, width, height, loading, decoding, style, data-*
* Note: only the alt and src attributes are escaped by default!
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\Utilities\ArrayHelper;
$img = HTMLHelper::_('cleanImageURL', $displayData['src']);
$displayData['src'] = $this->escape($img->url);
if (isset($displayData['alt']))
{
if ($displayData['alt'] === false)
{
unset($displayData['alt']);
}
else
{
$displayData['alt'] = $this->escape($displayData['alt']);
}
}
if ($img->attributes['width'] > 0 && $img->attributes['height'] > 0)
{
$displayData['width'] = $img->attributes['width'];
$displayData['height'] = $img->attributes['height'];
if (empty($displayData['loading']))
{
$displayData['loading'] = 'lazy';
}
}
echo '<img ' . ArrayHelper::toString($displayData) . '>';

View File

@ -385,7 +385,7 @@ class AdministratorApplication extends CMSApplication
if (!($result instanceof \Exception))
{
$lang = $this->input->getCmd('lang');
$lang = $this->input->getCmd('lang', '');
$lang = preg_replace('/[^A-Z-]/i', '', $lang);
if ($lang)

View File

@ -199,7 +199,7 @@ abstract class CMSApplication extends WebApplication implements ContainerAwareIn
public function enqueueMessage($msg, $type = self::MSG_INFO)
{
// Don't add empty messages.
if (trim($msg) === '')
if ($msg === null || trim($msg) === '')
{
return;
}

View File

@ -446,7 +446,7 @@ class ConsoleApplication extends Application implements DispatcherAwareInterface
*
* @return Router
*
* @since __DEPLOY_VERSION__
* @since 4.0.6
* @throws \InvalidArgumentException
*/
public static function getRouter($name = null, array $options = array())

View File

@ -11,6 +11,7 @@ namespace Joomla\CMS\Document;
\defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Cache\Cache;
use Joomla\CMS\Cache\CacheControllerFactoryInterface;
use Joomla\CMS\Factory as CmsFactory;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Helper\ModuleHelper;
@ -559,8 +560,21 @@ class HtmlDocument extends Document
if ($this->_caching == true && $type === 'modules' && $name !== 'debug')
{
/** @var \Joomla\CMS\Document\Renderer\Html\ModulesRenderer $renderer */
$cache = CmsFactory::getCache('com_modules', '');
$hash = md5(serialize(array($name, $attribs, null, get_class($renderer))));
/** @var \Joomla\CMS\Cache\Controller\OutputController $cache */
$cache = CmsFactory::getContainer()->get(CacheControllerFactoryInterface::class)
->createCacheController('output', ['defaultgroup' => 'com_modules']);
$itemId = (int) CmsFactory::getApplication()->input->get('Itemid', 0, 'int');
$hash = md5(
serialize(
[
$name,
$attribs,
\get_class($renderer),
$itemId,
]
)
);
$cbuffer = $cache->get('cbuffer_' . $type);
if (isset($cbuffer[$hash]))

View File

@ -74,7 +74,7 @@ class ComponentlayoutField extends FormField
if ($this->form instanceof Form)
{
$template_style_id = $this->form->getValue('template_style_id');
$template_style_id = $this->form->getValue('template_style_id', null, 0);
$template_style_id = (int) preg_replace('#\W#', '', $template_style_id);
}

View File

@ -321,7 +321,7 @@ class MediaField extends FormField
$this->folder = 'local-' . $adapterName . ':/' . implode('/', $paths);
}
}
elseif ($this->directory && strpos(':', $this->directory))
elseif ($this->directory && strpos($this->directory, ':'))
{
/**
* Directory contains adapter information and path, for example via programming or directly defined in xml

View File

@ -75,7 +75,7 @@ class ModulelayoutField extends FormField
if ($this->form instanceof Form)
{
$template_style_id = $this->form->getValue('template_style_id');
$template_style_id = $this->form->getValue('template_style_id', null, 0);
$template_style_id = (int) preg_replace('#\W#', '', $template_style_id);
}

View File

@ -242,7 +242,7 @@ class SubformField extends FormField
protected function getInput()
{
// Prepare data for renderer
$data = parent::getLayoutData();
$data = $this->getLayoutData();
$tmpl = null;
$control = $this->name;

View File

@ -45,7 +45,7 @@ class FormRule
* @var string
* @since 1.6
*/
protected $modifiers;
protected $modifiers = '';
/**
* Method to test the value.

View File

@ -684,19 +684,11 @@ abstract class HTMLHelper
{
$obj->attributes['width'] = $width;
}
else
{
unset($obj->attributes['width']);
}
if ($height > 0)
{
$obj->attributes['height'] = $height;
}
else
{
unset($obj->attributes['height']);
}
$mediaUri->setFragment('');
$obj->url = $mediaUri->toString();
@ -741,6 +733,12 @@ abstract class HTMLHelper
return $file;
}
// Ensure we have a valid default for concatenating
if ($attribs === null)
{
$attribs = '';
}
return '<img src="' . $file . '" alt="' . $alt . '" ' . trim((\is_array($attribs) ? ArrayHelper::toString($attribs) : $attribs)) . '>';
}

View File

@ -186,7 +186,7 @@ class MediaHelper
}
$allowable = array_map('trim', explode(',', $params->get('restrict_uploads_extensions', 'bmp,gif,jpg,jpeg,png,webp,ico,mp3,m4a,mp4a,ogg,mp4,mp4v,mpeg,mov,odg,odp,ods,odt,pdf,png,ppt,txt,xcf,xls,csv')));
$ignored = array_map('trim', explode(',', $params->get('ignore_extensions')));
$ignored = array_map('trim', explode(',', $params->get('ignore_extensions', '')));
if ($extension == '' || $extension == false || (!\in_array($extension, $allowable, true) && !\in_array($filetype, $ignored, true)))
{
@ -246,7 +246,7 @@ class MediaHelper
// Remove allowed executables from array
if (count($allowedExecutables))
{
$executable = array_diff($executables, $allowedExecutables);
$executables = array_diff($executables, $allowedExecutables);
}
$check = array_intersect($filetypes, $executables);
@ -261,7 +261,7 @@ class MediaHelper
$filetype = array_pop($filetypes);
$allowable = array_map('trim', explode(',', $params->get('restrict_uploads_extensions', 'bmp,gif,jpg,jpeg,png,webp,ico,mp3,m4a,mp4a,ogg,mp4,mp4v,mpeg,mov,odg,odp,ods,odt,pdf,png,ppt,txt,xcf,xls,csv')));
$ignored = array_map('trim', explode(',', $params->get('ignore_extensions')));
$ignored = array_map('trim', explode(',', $params->get('ignore_extensions', '')));
if ($filetype == '' || $filetype == false || (!\in_array($filetype, $allowable) && !\in_array($filetype, $ignored)))
{

View File

@ -84,12 +84,10 @@ abstract class ModuleHelper
public static function &getModules($position)
{
$position = strtolower($position);
$result = array();
$input = Factory::getApplication()->input;
$modules =& static::load();
$total = \count($modules);
$result = array();
$input = Factory::getApplication()->input;
$modules = &static::load();
$total = \count($modules);
for ($i = 0; $i < $total; $i++)
{
@ -99,14 +97,16 @@ abstract class ModuleHelper
}
}
if (\count($result) === 0)
// Prepend a dummy module for template preview
if ($input->getBool('tp') && ComponentHelper::getParams('com_templates')->get('template_positions_display'))
{
if ($input->getBool('tp') && ComponentHelper::getParams('com_templates')->get('template_positions_display'))
{
$result[0] = static::createDummyModule();
$result[0]->title = $position;
$result[0]->position = $position;
}
$dummy = static::createDummyModule();
$dummy->title = $position;
$dummy->position = $position;
$dummy->content = $position;
$dummy->contentRendered = true;
array_unshift($result, $dummy);
}
return $result;

View File

@ -23,6 +23,7 @@ use Joomla\CMS\Table\Extension;
use Joomla\CMS\Table\Table;
use Joomla\Database\DatabaseDriver;
use Joomla\Database\Exception\ExecutionFailureException;
use Joomla\Database\Exception\PrepareStatementFailureException;
use Joomla\Database\ParameterType;
/**
@ -1174,6 +1175,9 @@ class Installer extends Adapter
$version = '0.0.0';
}
Log::add(Text::_('JLIB_INSTALLER_SQL_BEGIN'), Log::INFO, 'Update');
Log::add(Text::sprintf('JLIB_INSTALLER_SQL_BEGIN_SCHEMA', $version), Log::INFO, 'Update');
foreach ($files as $file)
{
if (version_compare($file, $version) > 0)
@ -1200,19 +1204,28 @@ class Installer extends Adapter
// Process each query in the $queries array (split out of sql file).
foreach ($queries as $query)
{
$queryString = (string) $query;
$queryString = str_replace(array("\r", "\n"), array('', ' '), substr($queryString, 0, 80));
try
{
$db->setQuery($query)->execute();
}
catch (ExecutionFailureException $e)
catch (ExecutionFailureException | PrepareStatementFailureException $e)
{
Log::add(Text::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $e->getMessage()), Log::WARNING, 'jerror');
$errorMessage = Text::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $e->getMessage());
// Log the error in the update log file
Log::add(Text::sprintf('JLIB_INSTALLER_UPDATE_LOG_QUERY', $file, $queryString), Log::INFO, 'Update');
Log::add($errorMessage, Log::INFO, 'Update');
Log::add(Text::_('JLIB_INSTALLER_SQL_END_NOT_COMPLETE'), Log::INFO, 'Update');
// Show the error message to the user
Log::add($errorMessage, Log::WARNING, 'jerror');
return false;
}
$queryString = (string) $query;
$queryString = str_replace(array("\r", "\n"), array('', ' '), substr($queryString, 0, 80));
Log::add(Text::sprintf('JLIB_INSTALLER_UPDATE_LOG_QUERY', $file, $queryString), Log::INFO, 'Update');
$update_count++;
@ -1248,6 +1261,8 @@ class Installer extends Adapter
return false;
}
Log::add(Text::_('JLIB_INSTALLER_SQL_END'), Log::INFO, 'Update');
}
}
}

View File

@ -310,7 +310,7 @@ class BaseController implements ControllerInterface, DispatcherAwareInterface
else
{
// Base controller.
$type = null;
$type = '';
// Define the controller filename and path.
$file = self::createFileName('controller', array('name' => 'controller', 'format' => $format));

View File

@ -44,7 +44,11 @@ class Database implements ServiceProviderInterface
{
$conf = $container->get('config');
$dbtype = $conf->get('dbtype');
/**
* @todo: This 'sensible' default is required in the installer for now. Eventually we need to
* refactor the installer so it is not required
*/
$dbtype = $conf->get('dbtype', 'mysqli');
/*
* In Joomla! 3.x and earlier the `mysql` type was used for the `ext/mysql` PHP extension, which is no longer supported.

View File

@ -132,7 +132,7 @@ abstract class PunycodeHelper
{
if (empty($uri))
{
return;
return '';
}
$parsed = UriHelper::parse_url($uri);

View File

@ -543,6 +543,11 @@ class User extends Table
}
// If no timestamp value is passed to function, than current time is used.
if ($timeStamp === null)
{
$timeStamp = 'now';
}
$date = Factory::getDate($timeStamp);
$userId = (int) $userId;
$lastVisit = $date->toSql();

View File

@ -562,7 +562,15 @@ abstract class UserHelper
$ua = Factory::getApplication()->client;
$uaString = $ua->userAgent;
$browserVersion = $ua->browserVersion;
$uaShort = str_replace($browserVersion, 'abcd', $uaString);
if ($browserVersion)
{
$uaShort = str_replace($browserVersion, 'abcd', $uaString);
}
else
{
$uaShort = $uaString;
}
return md5(Uri::base() . $uaShort);
}

View File

@ -328,7 +328,7 @@ abstract class ArticlesCategoryHelper
public static function _cleanIntrotext($introtext)
{
$introtext = str_replace(array('<p>', '</p>'), ' ', $introtext);
$introtext = strip_tags($introtext, '<a><em><strong>');
$introtext = strip_tags($introtext, '<a><em><strong><joomla-hidden-mail>');
$introtext = trim($introtext);
return $introtext;

View File

@ -27,7 +27,13 @@ use Joomla\CMS\Layout\LayoutHelper;
<?php if ($params->get('img_intro_full') !== 'none' && !empty($item->imageSrc)) : ?>
<figure class="newsflash-image">
<img src="<?php echo $item->imageSrc; ?>" alt="<?php echo $item->imageAlt; ?>">
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $item->imageSrc,
'alt' => $item->imageAlt,
]
); ?>
<?php if (!empty($item->imageCaption)) : ?>
<figcaption>
<?php echo $item->imageCaption; ?>

View File

@ -127,6 +127,10 @@ class PlgQuickiconPhpVersionCheck extends CMSPlugin
'security' => '2022-11-26',
'eos' => '2023-11-26',
),
'8.1' => array(
'security' => '2023-11-25',
'eos' => '2024-11-25',
),
);
// Fill our return array with default values

View File

@ -13,6 +13,8 @@ use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Uri\Uri;
use Joomla\Database\DatabaseDriver;
use Joomla\Event\DispatcherInterface;
use Joomla\Event\Event;
use Joomla\Event\SubscriberInterface;
/**
@ -127,8 +129,8 @@ class PlgSystemHttpHeaders extends CMSPlugin implements SubscriberInterface
/**
* Constructor.
*
* @param object &$subject The object to observe.
* @param array $config An optional associative array of configuration settings.
* @param DispatcherInterface $subject The object to observe.
* @param array $config An optional associative array of configuration settings.
*
* @since 4.0.0
*/
@ -163,7 +165,7 @@ class PlgSystemHttpHeaders extends CMSPlugin implements SubscriberInterface
*
* @since 4.0.0
*/
public function applyHashesToCspRule(): void
public function applyHashesToCspRule(Event $event): void
{
// CSP is only relevant on html pages. Let's early exit here.
if ($this->app->getDocument()->getType() !== 'html')
@ -252,7 +254,7 @@ class PlgSystemHttpHeaders extends CMSPlugin implements SubscriberInterface
*
* @since 4.0.0
*/
public function setHttpHeaders(): void
public function setHttpHeaders(Event $event): void
{
// Set the default header when they are enabled
$this->setStaticHeaders();

View File

@ -235,6 +235,18 @@ class PlgSystemRedirect extends CMSPlugin implements SubscriberInterface
// In case the url contains double // lets remove it
$destination = str_replace(Uri::root() . '/', Uri::root(), $dest);
// Always count redirect hits
$redirect->hits++;
try
{
$db->updateObject('#__redirect_links', $redirect, 'id');
}
catch (Exception $e)
{
// We don't log issues for now
}
$app->redirect($destination, (int) $redirect->header);
}

View File

@ -30,10 +30,10 @@ if ($paramsFontScheme)
{
if (stripos($paramsFontScheme, 'https://') === 0)
{
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', []);
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', []);
$this->getPreloadManager()->preload($paramsFontScheme, ['as' => 'style']);
$wa->registerAndUseStyle('fontscheme.current', $paramsFontScheme, [], ['media' => 'print', 'rel' => 'lazy-stylesheet', 'onload' => 'this.media=\'all\'']);
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preload($paramsFontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']);
$wa->registerAndUseStyle('fontscheme.current', $paramsFontScheme, [], ['media' => 'print', 'rel' => 'lazy-stylesheet', 'onload' => 'this.media=\'all\'', 'crossorigin' => 'anonymous']);
if (preg_match_all('/family=([^?:]*):/i', $paramsFontScheme, $matches) > 0)
{

View File

@ -45,10 +45,10 @@ if ($paramsFontScheme)
{
if (stripos($paramsFontScheme, 'https://') === 0)
{
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', []);
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', []);
$this->getPreloadManager()->preload($paramsFontScheme, ['as' => 'style']);
$wa->registerAndUseStyle('fontscheme.current', $paramsFontScheme, [], ['media' => 'print', 'rel' => 'lazy-stylesheet', 'onload' => 'this.media=\'all\'']);
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preload($paramsFontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']);
$wa->registerAndUseStyle('fontscheme.current', $paramsFontScheme, [], ['media' => 'print', 'rel' => 'lazy-stylesheet', 'onload' => 'this.media=\'all\'', 'crossorigin' => 'anonymous']);
if (preg_match_all('/family=([^?:]*):/i', $paramsFontScheme, $matches) > 0)
{

View File

@ -47,10 +47,10 @@ if ($paramsFontScheme)
{
if (stripos($paramsFontScheme, 'https://') === 0)
{
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', []);
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', []);
$this->getPreloadManager()->preload($paramsFontScheme, ['as' => 'style']);
$wa->registerAndUseStyle('fontscheme.current', $paramsFontScheme, [], ['media' => 'print', 'rel' => 'lazy-stylesheet', 'onload' => 'this.media=\'all\'']);
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preload($paramsFontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']);
$wa->registerAndUseStyle('fontscheme.current', $paramsFontScheme, [], ['media' => 'print', 'rel' => 'lazy-stylesheet', 'onload' => 'this.media=\'all\'', 'crossorigin' => 'anonymous']);
if (preg_match_all('/family=([^?:]*):/i', $paramsFontScheme, $matches) > 0)
{

View File

@ -41,10 +41,10 @@ if ($paramsFontScheme)
{
if (stripos($paramsFontScheme, 'https://') === 0)
{
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', []);
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', []);
$this->getPreloadManager()->preload($paramsFontScheme, ['as' => 'style']);
$wa->registerAndUseStyle('fontscheme.current', $paramsFontScheme, [], ['media' => 'print', 'rel' => 'lazy-stylesheet', 'onload' => 'this.media=\'all\'']);
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preload($paramsFontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']);
$wa->registerAndUseStyle('fontscheme.current', $paramsFontScheme, [], ['media' => 'print', 'rel' => 'lazy-stylesheet', 'onload' => 'this.media=\'all\'', 'crossorigin' => 'anonymous']);
if (preg_match_all('/family=([^?:]*):/i', $paramsFontScheme, $matches) > 0)
{

View File

@ -12,9 +12,9 @@ use Page\Acceptance\Administrator\MediaListPage;
use Step\Acceptance\Administrator\Media;
/*
* @todo test d&d upload of files
* @todo test download of files
* @todo enable skipped tests
* TODO test d&d upload of files
* TODO test download of files
* TODO enable skipped tests
*/
/**
@ -268,7 +268,7 @@ class MediaListCest
*
* @throws Exception
*
* @since 4.1.0
* @since 4.0.6
*/
public function searchInFilesAndFolders(Media $I)
{
@ -288,7 +288,7 @@ class MediaListCest
*
* @throws Exception
*
* @since 4.1.0
* @since 4.0.6
*/
public function searchIsClearedOnNavigate(Media $I)
{

View File

@ -124,7 +124,7 @@ class BannerCest
$I->haveHttpHeader('Content-Type', 'application/json');
$I->haveHttpHeader('Accept', 'application/vnd.api+json');
// Unpublish in order to allow the delete in the next step
// Trash in order to allow the delete in the next step
$I->sendPATCH('/banners/categories/' . $categoryId, ['title' => 'Another Title', 'published' => -2]);
$I->seeResponseCodeIs(HttpCode::OK);