Skip to content

Commit 86e6200

Browse files
xh3n1samtuke
authored andcommitted
Update jQuery version for for 3.4.0 too
1 parent 2d554d7 commit 86e6200

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

public_html/lists/admin/upgrade.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,19 @@ function output($message)
175175
// Update jQuery version referenced in public page HTML stored in the database
176176
if (version_compare($dbversion, '3.4.1', '<')) {
177177

178-
$pattern = "jquery-1.12.1.min.js";
178+
179+
179180
$replacement = "jquery.min.js";
180181

181182
// Replace jQuery version in config table.
182183
$oldConfigFooter = getConfig('pagefooter');
184+
$matches = null;
185+
186+
preg_match('/jquery-3.3.1.min.js/', $oldConfigFooter, $matches);
187+
if ($matches[0] == "jquery-3.3.1.min.js"){
188+
$pattern = "jquery-3.3.1.min.js";
189+
} else $pattern = "jquery-1.12.1.min.js";
190+
183191
$newConfigFooter = str_replace($pattern, $replacement, $oldConfigFooter);
184192
SaveConfig('pagefooter', $newConfigFooter);
185193

@@ -190,6 +198,11 @@ function output($message)
190198
$footersArray[] = $row['data'];
191199
}
192200
foreach ($footersArray as $key => $value) {
201+
preg_match('/jquery-3.3.1.min.js/', $value, $matches);
202+
if ($matches[0] == "jquery-3.3.1.min.js"){
203+
$pattern = "jquery-3.3.1.min.js";
204+
} else $pattern = "jquery-1.12.1.min.js";
205+
193206
$newFooter = str_replace($pattern, $replacement, $value);
194207
Sql_Query(sprintf('update %s set data = "%s" where data = "%s" ', $GLOBALS['tables']['subscribepage_data'], sql_escape($newFooter), addslashes($value)));
195208
}

0 commit comments

Comments
 (0)