Allow % in view definer (thanks to Tomas Votruba)
This commit is contained in:
parent
70066b3f37
commit
021e1e319c
|
@ -521,7 +521,7 @@ username.form['driver'].onchange();
|
||||||
}
|
}
|
||||||
if ($is_view) {
|
if ($is_view) {
|
||||||
// remove DEFINER with current user
|
// remove DEFINER with current user
|
||||||
$create = preg_replace('~^([A-Z =]+) DEFINER=`' . str_replace("@", "`@`", logged_user()) . '`~', '\\1', $create); //! proper escaping of user
|
$create = preg_replace('~^([A-Z =]+) DEFINER=`' . preg_replace('~@(.*)~', '`@`(%|\\1)', logged_user()) . '`~', '\\1', $create); //! proper escaping of user
|
||||||
}
|
}
|
||||||
echo ($style != "CREATE+ALTER" ? $create : ($is_view ? substr_replace($create, " OR REPLACE", 6, 0) : substr_replace($create, " IF NOT EXISTS", 12, 0))) . ";\n\n";
|
echo ($style != "CREATE+ALTER" ? $create : ($is_view ? substr_replace($create, " OR REPLACE", 6, 0) : substr_replace($create, " IF NOT EXISTS", 12, 0))) . ";\n\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue