Skip to content

Commit 2f3adbd

Browse files
author
DenysTsymbal
committed
8139-blog-csv-import-error-add-compatibility-with-php8+
1 parent caab506 commit 2f3adbd

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

Controller/Adminhtml/Post/Save.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ protected function filterParams($data)
167167
$filterRules[$dateField] = $dateFilter;
168168
$data[$dateField] = preg_replace('/(.*)(\+\d\d\d\d\d\d)(\d\d)/U', '$1$3', $data[$dateField]);
169169

170-
if (!preg_match('/\d{1}:\d{2}/', $data[$dateField])) {
170+
if (!preg_match('/\d{1}:\d{2}/', (string)$data[$dateField])) {
171171
/*$data[$dateField] .= " 00:00";*/
172172
$filterRules[$dateField] = $dateFilter;
173173
} else {

Model/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public function getFirstImage()
451451
if (!$image) {
452452
$content = $this->getFilteredContent();
453453
$match = null;
454-
preg_match('/<img.+src=[\'"](?P<src>.+?)[\'"].*>/i', $content, $match);
454+
preg_match('/<img.+src=[\'"](?P<src>.+?)[\'"].*>/i', (string)$content, $match);
455455
if (!empty($match['src'])) {
456456
$image = $match['src'];
457457
}

Model/ResourceModel/Category.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ protected function _getLoadByIdentifierSelect($identifier, $storeIds)
206206
*/
207207
protected function isNumericPageIdentifier(\Magento\Framework\Model\AbstractModel $object)
208208
{
209-
return preg_match('/^[0-9]+$/', $object->getData('identifier'));
209+
return preg_match('/^[0-9]+$/', (string)$object->getData('identifier'));
210210
}
211211

212212
/**
@@ -217,7 +217,7 @@ protected function isNumericPageIdentifier(\Magento\Framework\Model\AbstractMode
217217
*/
218218
protected function isValidPageIdentifier(\Magento\Framework\Model\AbstractModel $object)
219219
{
220-
return preg_match('/^([^?#<>@!&*()$%^\\+=,{}"\']+)?$/', $object->getData('identifier'));
220+
return preg_match('/^([^?#<>@!&*()$%^\\+=,{}"\']+)?$/', (string)$object->getData('identifier'));
221221
}
222222

223223
/**

Model/ResourceModel/Post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ protected function _getLoadByIdentifierSelect($identifier, $storeIds)
358358
*/
359359
protected function isNumericPageIdentifier(\Magento\Framework\Model\AbstractModel $object)
360360
{
361-
return preg_match('/^[0-9]+$/', $object->getData('identifier'));
361+
return preg_match('/^[0-9]+$/', (string)$object->getData('identifier'));
362362
}
363363

364364
/**
@@ -369,7 +369,7 @@ protected function isNumericPageIdentifier(\Magento\Framework\Model\AbstractMode
369369
*/
370370
protected function isValidPageIdentifier(\Magento\Framework\Model\AbstractModel $object)
371371
{
372-
return preg_match('/^([^?#<>@!&*()$%^\\+=,{}"\']+)?$/', $object->getData('identifier'));
372+
return preg_match('/^([^?#<>@!&*()$%^\\+=,{}"\']+)?$/', (string)$object->getData('identifier'));
373373
}
374374

375375
/**

Model/ResourceModel/Tag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
142142
*/
143143
protected function isNumericPageIdentifier(\Magento\Framework\Model\AbstractModel $object)
144144
{
145-
return preg_match('/^[0-9]+$/', $object->getData('identifier'));
145+
return preg_match('/^[0-9]+$/', (string)$object->getData('identifier'));
146146
}
147147

148148
/**
@@ -153,7 +153,7 @@ protected function isNumericPageIdentifier(\Magento\Framework\Model\AbstractMode
153153
*/
154154
protected function isValidPageIdentifier(\Magento\Framework\Model\AbstractModel $object)
155155
{
156-
return preg_match('/^([^?#<>@!&*()$%^\\+=,{}"\']+)?$/', $object->getData('identifier'));
156+
return preg_match('/^([^?#<>@!&*()$%^\\+=,{}"\']+)?$/', (string)$object->getData('identifier'));
157157
}
158158

159159
/**

0 commit comments

Comments
 (0)