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

Merge branch '4.3-dev' into 4.4-dev

This commit is contained in:
Allon Moritz 2023-09-04 08:34:28 +02:00
commit e41bae273e
No known key found for this signature in database
GPG Key ID: 6486E0BC67E6DDF4
2 changed files with 5 additions and 3 deletions

View File

@ -1204,7 +1204,9 @@ class ApplicationModel extends FormModel implements MailerFactoryAwareInterface
$mailer = new MailTemplate('com_config.test_mail', $user->getParam('language', $app->get('language')), $mail);
$mailer->addTemplateData(
[
'sitename' => $app->get('sitename'),
// Replace the occurrences of "@" and "|" in the site name in order to send the test mail, as these
// characters produce an error else wise: https://github.com/joomla/joomla-cms/issues/41061
'sitename' => preg_filter(['/@/', '/\|/'], '', $app->get('sitename'), -1),
'method' => Text::_('COM_CONFIG_SENDMAIL_METHOD_' . strtoupper($mail->Mailer)),
]
);

View File

@ -132,7 +132,7 @@ class Language
*
* Regexes:
* 1. Remove everything except letters, numbers, quotes, apostrophe, plus, dash, period, and comma.
* 2. Remove plus, dash, period, and comma characters located before letter characters.
* 2. Remove plus, dash, and comma characters located before letter characters.
* 3. Remove plus, dash, period, and comma characters located after other characters.
* 4. Remove plus, period, and comma characters enclosed in alphabetical characters. Ungreedy.
* 5. Remove orphaned apostrophe, plus, dash, period, and comma characters.
@ -142,7 +142,7 @@ class Language
*/
$input = StringHelper::strtolower($input);
$input = preg_replace('#[^\pL\pM\pN\p{Pi}\p{Pf}\'+-.,]+#mui', ' ', $input);
$input = preg_replace('#(^|\s)[+-.,]+([\pL\pM]+)#mui', ' $1', $input);
$input = preg_replace('#(^|\s)[+-,]+([\pL\pM]+)#mui', ' $1', $input);
$input = preg_replace('#([\pL\pM\pN]+)[+-.,]+(\s|$)#mui', '$1 ', $input);
$input = preg_replace('#([\pL\pM]+)[+.,]+([\pL\pM]+)#muiU', '$1 $2', $input);
$input = preg_replace('#(^|\s)[\'+-.,]+(\s|$)#mui', ' ', $input);