diff --git a/lib-3rd-party/pquery/gan_node_html.php b/lib-3rd-party/pquery/gan_node_html.php
index 91523caa71..ea5030d5a4 100644
--- a/lib-3rd-party/pquery/gan_node_html.php
+++ b/lib-3rd-party/pquery/gan_node_html.php
@@ -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);
}
/**
diff --git a/lib/Mailer/Methods/ErrorMappers/SMTPMapper.php b/lib/Mailer/Methods/ErrorMappers/SMTPMapper.php
index 117d87a040..f6228a3ba3 100644
--- a/lib/Mailer/Methods/ErrorMappers/SMTPMapper.php
+++ b/lib/Mailer/Methods/ErrorMappers/SMTPMapper.php
@@ -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
diff --git a/lib/Newsletter/Renderer/Blocks/Text.php b/lib/Newsletter/Renderer/Blocks/Text.php
index a197cb40f4..4caa29cfd8 100644
--- a/lib/Newsletter/Renderer/Blocks/Text.php
+++ b/lib/Newsletter/Renderer/Blocks/Text.php
@@ -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;
}
diff --git a/lib/Newsletter/Renderer/StylesHelper.php b/lib/Newsletter/Renderer/StylesHelper.php
index 7c374f2fc7..ff06043373 100644
--- a/lib/Newsletter/Renderer/StylesHelper.php
+++ b/lib/Newsletter/Renderer/StylesHelper.php
@@ -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;';
}
diff --git a/lib/Subscribers/ImportExport/Export/Export.php b/lib/Subscribers/ImportExport/Export/Export.php
index e53a6d2fb9..1dfcde38a9 100644
--- a/lib/Subscribers/ImportExport/Export/Export.php
+++ b/lib/Subscribers/ImportExport/Export/Export.php
@@ -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