1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

Escape JavaScript strings (bug #3093243)

This commit is contained in:
Jakub Vrana
2010-10-22 23:07:30 +02:00
parent 7d601c07fc
commit 28f21aaa6c
5 changed files with 16 additions and 8 deletions

View File

@@ -7,7 +7,7 @@ $table_pos_js = array();
preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~', $_COOKIE["adminer_schema"], $matches, PREG_SET_ORDER); //! ':' in table name
foreach ($matches as $i => $match) {
$table_pos[$match[1]] = array($match[2], $match[3]);
$table_pos_js[] = "\n\t'" . addcslashes($match[1], "\r\n'\\/") . "': [ $match[2], $match[3] ]";
$table_pos_js[] = "\n\t'" . js_escape($match[1]) . "': [ $match[2], $match[3] ]";
}
$top = 0;