Ignore:
Timestamp:
May 4, 2020 2:25:31 AM (4 years ago)
Author:
anonymous
Message:

Use the /u regex modifier only when using UTF-8. Disable indexed array key removal from URL query args.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Email.inc.php

    r696 r724  
    102102    public function __construct($params=null)
    103103    {
     104        $app =& App::getInstance();
     105
    104106        // The regex used in validEmail(). Set here instead of in the default _params above so we can use the concatenation . dot.
    105107        // This matches a (valid) email address as complex as:
     
    118120        . '(?:\s*>\s*|>\s+\([^,@]+\)\s*)'                               // TRUE, ensure ending >
    119121        . '|'
    120         . '(?:|\s*|\s+\([^,@]+\)\s*))$/iu'));                            // FALSE ensure there is no ending >
     122        . '(?:|\s*|\s+\([^,@]+\)\s*))$/i' . $app->getParam('preg_u'))); // FALSE ensure there is no ending >
    121123
    122124        if (isset($params)) {
     
    396398            $envelope_sender_address = sprintf('<%s>', trim($this->_params['envelope_sender_address'], '<>'));
    397399        } else {
    398             $envelope_sender_address = preg_replace('/^.*<?([^\s@\[\]<>()]+\@[A-Za-z0-9.-]{1,}\.[A-Za-z]{2,5})>?$/iUu', '$1', $this->_params['from']);
     400            $envelope_sender_address = preg_replace('/^.*<?([^\s@\[\]<>()]+\@[A-Za-z0-9.-]{1,}\.[A-Za-z]{2,5})>?$/iU' . $app->getParam('preg_u'), '$1', $this->_params['from']);
    399401        }
    400402        if ('' != $envelope_sender_address && $this->validEmail($envelope_sender_address)) {
Note: See TracChangeset for help on using the changeset viewer.