Skip to content

Commit

Permalink
Encoding\DkimTagValue: Allow trailing separator
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrsagen committed Apr 26, 2024
1 parent 88736a3 commit 23330fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alexrsagen/obie",
"version": "1.6.6",
"version": "1.6.7",
"type": "framework",
"description": "Obie is a simple PHP framework. It aims to provide basic services needed for any web app.",
"keywords": ["framework", "php", "http", "template", "view", "router", "routing", "model", "models", "session", "sessions"],
Expand Down
8 changes: 7 additions & 1 deletion src/encoding/dkim_tag_value.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ public static function decode(string $input, bool $strict = true, string $versio
$output = new TagList();

$tag_list = explode(';', $input);
foreach ($tag_list as $tag_spec) {
foreach ($tag_list as $i => $tag_spec) {
// allow trailing separator
if ($i === count($tag_list) - 1 && strlen($tag_spec) === 0) {
break;
}

// extract tag-name and tag-value
$tag_name_value = explode('=', $tag_spec, 2);
if (count($tag_name_value) !== 2) {
Log::warning('DkimTagValue: unexpected tag-spec without tag-value');
Expand Down

0 comments on commit 23330fe

Please sign in to comment.