Skip to content

Commit

Permalink
Bugfix: Replacing non-ascii characters would cause a PHP error
Browse files Browse the repository at this point in the history
  • Loading branch information
michielgerritsen committed Mar 15, 2021
1 parent df2c52b commit 28044b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/code/community/Mollie/Mpm/Model/OrderLines.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ public function getOpenForRefundQty($orderId)
*/
private function getProductName($name)
{
$search = explode('', 'ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,ø,Ø,Å,Á,À,Â,Ä,È,É,Ê,Ë,Í,Î,Ï,Ì,Ò,Ó,Ô,Ö,Ú,Ù,Û,Ü,Ÿ,Ç,Æ,Œ');
$replace = explode('', 'c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,o,O,A,A,A,A,A,E,E,E,E,I,I,I,I,O,O,O,O,U,U,U,U,Y,C,AE,OE');
$search = explode(',', 'ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,ø,Ø,Å,Á,À,Â,Ä,È,É,Ê,Ë,Í,Î,Ï,Ì,Ò,Ó,Ô,Ö,Ú,Ù,Û,Ü,Ÿ,Ç,Æ,Œ');
$replace = explode(',', 'c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,o,O,A,A,A,A,A,E,E,E,E,I,I,I,I,O,O,O,O,U,U,U,U,Y,C,AE,OE');
$name = str_replace($search, $replace, $name);

return preg_replace('/[^A-Za-z0-9 -]/', '', $name);
Expand Down

0 comments on commit 28044b0

Please sign in to comment.