Skip to content

Commit

Permalink
Updated extensions for Giovanni
Browse files Browse the repository at this point in the history
  • Loading branch information
markseuffert committed Apr 3, 2024
1 parent 5c9bbaa commit c77e73c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
25 changes: 23 additions & 2 deletions system/extensions/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1456,6 +1456,27 @@ public function normaliseData($text, $type = "html", $filterStrict = true) {
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 = "";
Expand All @@ -1470,7 +1491,7 @@ public function normaliseHeaders($input, $type = "mime", $filterStrict = true) {
$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 ";
Expand Down
6 changes: 3 additions & 3 deletions system/extensions/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1605,8 +1605,8 @@ public function sendMail($scheme, $address, $base, $email, $action) {
$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",
Expand Down
12 changes: 6 additions & 6 deletions system/extensions/update-available.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions system/extensions/update-current.ini
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit c77e73c

Please sign in to comment.