Skip to content

Commit

Permalink
lowercase mailto:-addresses in getNormalizedValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
pk1234 committed Feb 20, 2022
1 parent 06feff3 commit c2a5ecd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Property/ICalendar/CalAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ public function getNormalizedValue()
return $input;
}
list($schema, $everythingElse) = explode(':', $input, 2);
$schema = strtolower($schema);
if($schema == "mailto") {
$everythingElse = strtolower($everythingElse);
}

return strtolower($schema).':'.$everythingElse;
return $schema.':'.$everythingElse;
}
}
2 changes: 2 additions & 0 deletions tests/VObject/Property/ICalendar/CalAddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public function values()
return [
['mailto:a@b.com', 'mailto:a@b.com'],
['mailto:a@b.com', 'MAILTO:a@b.com'],
['mailto:a@b.com', 'mailto:A@B.COM'],
['mailto:a@b.com', 'MAILTO:A@B.COM'],
['/foo/bar', '/foo/bar'],
];
}
Expand Down

0 comments on commit c2a5ecd

Please sign in to comment.