WordPress.org

Make WordPress Core

Ticket #19808: class-phpmailer.php.v2.diff

File class-phpmailer.php.v2.diff, 1.2 KB (added by WPsites, 2 years ago)

New patch with pipe removed

  • trunk/wp-includes/class-phpmailer.php

     
    21542154   * @return $message 
    21552155   */ 
    21562156  public function MsgHTML($message, $basedir = '') { 
    2157     preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images); 
     2157    preg_match_all("/(src|background)=[\"'](.*)[\"']/Ui", $message, $images); 
    21582158    if(isset($images[2])) { 
    21592159      foreach($images[2] as $i => $url) { 
    21602160        // do not change urls for absolute images (thanks to corvuscorax) 
     
    21682168          if ( strlen($basedir) > 1 && substr($basedir, -1) != '/') { $basedir .= '/'; } 
    21692169          if ( strlen($directory) > 1 && substr($directory, -1) != '/') { $directory .= '/'; } 
    21702170          if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64', $mimeType) ) { 
    2171             $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message); 
     2171            $message = preg_replace("/".$images[1][$i]."=[\"']".preg_quote($url, '/')."[\"']/Ui", $images[1][$i]."=\"".$cid."\"", $message); 
    21722172          } 
    21732173        } 
    21742174      }