Skip to content
Permalink
Browse files

Quote delimiter before using preg_replace

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information...
nijel committed Jun 20, 2016
1 parent 4bcc606 commit 1cc7466db3a05e95fe57a6702f41773e6829d54b
@@ -111,7 +111,7 @@
&& is_array($_REQUEST['parameters'])) {
$parameters = $_REQUEST['parameters'];
foreach ($parameters as $parameter => $replacement) {
$quoted = preg_quote($parameter);
$quoted = preg_quote($parameter, '/');
// making sure that :param does not apply values to :param1
$sql_query = preg_replace(
'/' . $quoted . '([^a-zA-Z0-9_])/',
@@ -903,7 +903,7 @@ static public function handleQuery($query)
// Cut off `dbname`. from query
$query = preg_replace(
'/`' . preg_quote($dbname) . '`\s?\./',
'/`' . preg_quote($dbname, '/') . '`\s?\./',
'',
$query
);
@@ -1506,7 +1506,7 @@ public function getTableDef(
*/
if ($view) {
$create_query = preg_replace(
'/' . preg_quote(Util::backquote($db)) . '\./',
'/' . preg_quote(Util::backquote($db), '/') . '\./',
'',
$create_query
);
@@ -7,7 +7,7 @@
<?php
$checked = isset($columnMeta['Field'])
&& isset($mime_map[$columnMeta['Field']][$type])
&& preg_match('@' . preg_quote($available_mime[$type . '_file'][$mimekey]) . '3?@i',
&& preg_match('@' . preg_quote($available_mime[$type . '_file'][$mimekey], '@') . '3?@i',
$mime_map[$columnMeta['Field']][$type]) ? 'selected ' : '';
$tooltip = PMA_getTransformationDescription(
$available_mime[$type . '_file'][$mimekey]
@@ -24,4 +24,4 @@
</option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</select>
@@ -59,7 +59,7 @@ function testMissingExtensionFatal()
. '" target="Documentation"><em>' . $ext
. '</em></a> extension is missing. Please check your PHP configuration.';
$this->expectOutputRegex('@' . preg_quote($warn) . '@');
$this->expectOutputRegex('@' . preg_quote($warn, '@') . '@');
PMA_warnMissingExtension($ext, true);
}

0 comments on commit 1cc7466

Please sign in to comment.
You can’t perform that action at this time.