Skip to content

Commit 7df0309

Browse files
authored
Merge pull request #697 from favicode/fix/deprecated-functionality
Fixing deprecated usage - adding cast to string and tags size check
2 parents 0ed56f1 + 37969c8 commit 7df0309

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Model/Api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ public function uploadSnippet($version, array $snippet)
534534
if (isset($snippet['content'])) {
535535
$adminUrl = $this->vcl->getAdminFrontName();
536536
$adminPathTimeout = $this->config->getAdminPathTimeout();
537-
$ignoredUrlParameters = $this->config->getIgnoredUrlParameters();
537+
$ignoredUrlParameters = (string)$this->config->getIgnoredUrlParameters();
538538

539539
if ($ignoredUrlParameters === "") {
540540
$queryParameters = '&';

Model/ResponsePlugin.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ public function aroundSetHeader(Http $subject, callable $proceed, $name, $value,
7979
// Make the necessary adjustment
8080
$value = $this->cacheTags->convertCacheTags(str_replace(',', ' ', $value));
8181
$tagsSize = $this->config->getXMagentoTagsSize();
82-
if (strlen($value) > $tagsSize) {
82+
83+
if ($tagsSize === 0) {
84+
$value = "";
85+
} else if (strlen($value) > $tagsSize) {
8386
$trimmedArgs = substr($value, 0, $tagsSize);
8487
$value = substr($trimmedArgs, 0, strrpos($trimmedArgs, ' ', -1));
8588
}

0 commit comments

Comments
 (0)