Fix deprecated usage of string functions
[MAILPOET-4001]
This commit is contained in:
6
lib-3rd-party/pquery/gan_node_html.php
vendored
6
lib-3rd-party/pquery/gan_node_html.php
vendored
@@ -1453,7 +1453,7 @@ class DomNode implements IQuery {
|
||||
* @return bool
|
||||
*/
|
||||
function hasClass($className) {
|
||||
return ($className && preg_match('`\b'.preg_quote($className).'\b`si', $this->class));
|
||||
return ($className && preg_match('`\b'.preg_quote($className).'\b`si', (string)$this->class));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1466,11 +1466,11 @@ class DomNode implements IQuery {
|
||||
}
|
||||
$class = $this->class;
|
||||
foreach ($className as $c) {
|
||||
if (!(preg_match('`\b'.preg_quote($c).'\b`si', $class) > 0)) {
|
||||
if (!(preg_match('`\b'.preg_quote($c).'\b`si', (string)$class) > 0)) {
|
||||
$class .= ' '.$c;
|
||||
}
|
||||
}
|
||||
$this->class = trim($class);
|
||||
$this->class = trim((string)$class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -39,7 +39,7 @@ class SMTPMapper {
|
||||
|
||||
public function getErrorFromLog($log, $subscriber) {
|
||||
// extract error message from log
|
||||
preg_match('/!! (.*?)>>/ism', $log, $message);
|
||||
preg_match('/!! (.*?)>>/ism', (string)$log, $message);
|
||||
if (!empty($message[1])) {
|
||||
$message = $message[1];
|
||||
// remove line breaks from the message due to how logger's dump() method works
|
||||
|
@@ -101,7 +101,7 @@ class Text {
|
||||
$paragraph->remove();
|
||||
continue;
|
||||
}
|
||||
$style = $paragraph->style;
|
||||
$style = (string)$paragraph->style;
|
||||
if (!preg_match('/text-align/i', $style)) {
|
||||
$style = 'text-align: left;' . $style;
|
||||
}
|
||||
|
@@ -104,13 +104,13 @@ class StylesHelper {
|
||||
$textAlignment = isset($block['styles']['block']['textAlign']) ?
|
||||
strtolower($block['styles']['block']['textAlign']) :
|
||||
'';
|
||||
if (preg_match('/center|right|justify/i', $textAlignment)) {
|
||||
if (preg_match('/center|right|justify/i', (string)$textAlignment)) {
|
||||
return $block;
|
||||
}
|
||||
$block['styles']['block']['textAlign'] = 'left';
|
||||
return $block;
|
||||
}
|
||||
return (preg_match('/text-align.*?[center|justify|right]/i', $block)) ?
|
||||
return (preg_match('/text-align.*?[center|justify|right]/i', (string)$block)) ?
|
||||
$block :
|
||||
$block . 'text-align:left;';
|
||||
}
|
||||
|
@@ -113,7 +113,7 @@ class Export {
|
||||
throw new \Exception(__('Failed opening file for export.', 'mailpoet'));
|
||||
}
|
||||
$formatCSV = function($row) {
|
||||
return '"' . str_replace('"', '\"', $row) . '"';
|
||||
return '"' . str_replace('"', '\"', (string)$row) . '"';
|
||||
};
|
||||
// add UTF-8 BOM (3 bytes, hex EF BB BF) at the start of the file for
|
||||
// Excel to automatically recognize the encoding
|
||||
|
Reference in New Issue
Block a user