Skip to content

Commit 1cc7466

Browse files
committed
Quote delimiter before using preg_replace
Signed-off-by: Michal Čihař <michal@cihar.com>
1 parent 4bcc606 commit 1cc7466

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

Diff for: import.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
&& is_array($_REQUEST['parameters'])) {
112112
$parameters = $_REQUEST['parameters'];
113113
foreach ($parameters as $parameter => $replacement) {
114-
$quoted = preg_quote($parameter);
114+
$quoted = preg_quote($parameter, '/');
115115
// making sure that :param does not apply values to :param1
116116
$sql_query = preg_replace(
117117
'/' . $quoted . '([^a-zA-Z0-9_])/',

Diff for: libraries/Tracker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ static public function handleQuery($query)
903903

904904
// Cut off `dbname`. from query
905905
$query = preg_replace(
906-
'/`' . preg_quote($dbname) . '`\s?\./',
906+
'/`' . preg_quote($dbname, '/') . '`\s?\./',
907907
'',
908908
$query
909909
);

Diff for: libraries/plugins/export/ExportSql.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ public function getTableDef(
15061506
*/
15071507
if ($view) {
15081508
$create_query = preg_replace(
1509-
'/' . preg_quote(Util::backquote($db)) . '\./',
1509+
'/' . preg_quote(Util::backquote($db), '/') . '\./',
15101510
'',
15111511
$create_query
15121512
);

Diff for: templates/columns_definitions/transformation.phtml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<?php
88
$checked = isset($columnMeta['Field'])
99
&& isset($mime_map[$columnMeta['Field']][$type])
10-
&& preg_match('@' . preg_quote($available_mime[$type . '_file'][$mimekey]) . '3?@i',
10+
&& preg_match('@' . preg_quote($available_mime[$type . '_file'][$mimekey], '@') . '3?@i',
1111
$mime_map[$columnMeta['Field']][$type]) ? 'selected ' : '';
1212
$tooltip = PMA_getTransformationDescription(
1313
$available_mime[$type . '_file'][$mimekey]
@@ -24,4 +24,4 @@
2424
</option>
2525
<?php endforeach; ?>
2626
<?php endif; ?>
27-
</select>
27+
</select>

Diff for: test/libraries/core/PMA_warnMissingExtension_test.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function testMissingExtensionFatal()
5959
. '" target="Documentation"><em>' . $ext
6060
. '</em></a> extension is missing. Please check your PHP configuration.';
6161

62-
$this->expectOutputRegex('@' . preg_quote($warn) . '@');
62+
$this->expectOutputRegex('@' . preg_quote($warn, '@') . '@');
6363

6464
PMA_warnMissingExtension($ext, true);
6565
}

0 commit comments

Comments
 (0)