mikuli.cz

:)
git clone https://git.sr.ht/~ashymad/mikuli.cz
Log | Files | Refs

commit c77e73c4e76710bb5e35b0b7adedb577a76efff8
parent 5c9bbaa55cf6dd99f35920e5d43c94cc326ace09
Author: markseu <mark2011@mayberg.se>
Date:   Wed,  3 Apr 2024 21:08:23 +0200

Updated extensions for Giovanni

Diffstat:
Msystem/extensions/core.php | 25+++++++++++++++++++++++--
Msystem/extensions/edit.php | 6+++---
Msystem/extensions/update-available.ini | 12++++++------
Msystem/extensions/update-current.ini | 8++++----
4 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/system/extensions/core.php b/system/extensions/core.php @@ -2,7 +2,7 @@ // Core extension, https://github.com/annaesvensson/yellow-core class YellowCore { - const VERSION = "0.8.131"; + const VERSION = "0.8.132"; const RELEASE = "0.8.23"; public $content; // content files public $media; // media files @@ -1456,6 +1456,27 @@ class YellowLookup { return $output; } + // Normalise name and email for a single address + public function normaliseAddress($input, $type = "mail", $filterStrict = true) { + $output = ""; + if ($type=="mail") { + if (preg_match("/^(.*?)(\s*)<(.*?)>$/", $input, $matches)) { + $name = $matches[1]; + $email = $matches[3]; + } else { + $name = ""; + $email = $input; + } + $name = preg_replace("/[^\pL\d\-\. ]/u", "", $name); + $name = preg_replace("/\s+/s", " ", $name); + if ($filterStrict && !preg_match("/^[\w\+\-\.\@]+$/", $email)) { + $email = "error-mail-filter"; + } + $output = is_string_empty($name) ? "<$email>" : "$name <$email>"; + } + return $output; + } + // Normalise fields in MIME headers public function normaliseHeaders($input, $type = "mime", $filterStrict = true) { $output = ""; @@ -1470,7 +1491,7 @@ class YellowLookup { $matches[1] = $matches[2] = ""; $matches[3] = $email; } - if ($filterStrict && !preg_match("/[\w\+\-\.\@]+/", $matches[3])) { + if ($filterStrict && !preg_match("/^[\w\+\-\.\@]+$/", $matches[3])) { $matches[3] = "error-mail-filter"; } if (substru($text, -2, 2)!=": ") $text .= ",\r\n "; diff --git a/system/extensions/edit.php b/system/extensions/edit.php @@ -2,7 +2,7 @@ // Edit extension, https://github.com/annaesvensson/yellow-edit class YellowEdit { - const VERSION = "0.8.78"; + const VERSION = "0.8.79"; public $yellow; // access to API public $response; // web response public $merge; // text merge @@ -1605,8 +1605,8 @@ class YellowEditResponse { $footer = str_replace("\\n", "\r\n", $footer); $footer = preg_replace("/@sitename/i", $sitename, $footer); $mailHeaders = array( - "To" => "$userName <$userEmail>", - "From" => "$sitename <$siteEmail>", + "To" => $this->yellow->lookup->normaliseAddress("$userName <$userEmail>"), + "From" => $this->yellow->lookup->normaliseAddress("$sitename <$siteEmail>"), "Subject" => $subject, "Date" => date(DATE_RFC2822), "Mime-Version" => "1.0", diff --git a/system/extensions/update-available.ini b/system/extensions/update-available.ini @@ -120,14 +120,14 @@ Status: available system/extensions/chinese.php: chinese.php, create, update Extension: Contact -Version: 0.8.24 +Version: 0.8.25 Description: Email contact page. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-contact/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-contact DocumentationLanguage: en, de, sv -Published: 2024-04-01 19:29:34 +Published: 2024-04-03 18:33:18 Status: available system/extensions/contact.php: contact.php, create, update system/layouts/contact.html: contact.html, create, update, careful @@ -148,14 +148,14 @@ system/themes/copenhagen.css: copenhagen.css, create, update, careful system/themes/copenhagen.png: copenhagen.png, create Extension: Core -Version: 0.8.131 +Version: 0.8.132 Description: Core functionality of your website. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-core/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-core DocumentationLanguage: en, de, sv -Published: 2024-04-02 20:52:39 +Published: 2024-04-03 21:03:27 Status: available system/extensions/core.php: core.php, create, update system/layouts/default.html: default.html, create, update, careful @@ -211,14 +211,14 @@ Status: available system/extensions/dutch.php: dutch.php, create, update Extension: Edit -Version: 0.8.78 +Version: 0.8.79 Description: Edit your website in a web browser. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-edit/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-edit DocumentationLanguage: en, de, sv -Published: 2024-04-01 18:48:05 +Published: 2024-04-03 19:54:42 Status: available system/extensions/edit.php: edit.php, create, update system/extensions/edit.css: edit.css, create, update diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini @@ -1,14 +1,14 @@ # Datenstrom Yellow update settings for installed extensions Extension: Core -Version: 0.8.131 +Version: 0.8.132 Description: Core functionality of your website. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-core/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-core DocumentationLanguage: en, de, sv -Published: 2024-04-02 20:52:39 +Published: 2024-04-03 21:03:27 Status: available system/extensions/core.php: core.php, create, update system/layouts/default.html: default.html, create, update, careful @@ -19,14 +19,14 @@ system/layouts/navigation.html: navigation.html, create, update, careful system/layouts/pagination.html: pagination.html, create, update, careful Extension: Edit -Version: 0.8.78 +Version: 0.8.79 Description: Edit your website in a web browser. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-edit/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-edit DocumentationLanguage: en, de, sv -Published: 2024-04-01 18:48:05 +Published: 2024-04-03 19:54:42 Status: available system/extensions/edit.php: edit.php, create, update system/extensions/edit.css: edit.css, create, update