1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-18 04:11:27 +02:00

Use script_src for <script src>

This commit is contained in:
Jakub Vrana
2018-01-13 16:25:11 +01:00
parent 144c7de27f
commit 9d532fc0a1
8 changed files with 34 additions and 23 deletions

View File

@@ -890,15 +890,13 @@ class Adminer {
$connection->select_db(DB);
$tables = table_status('', true);
}
?>
<script src="../externals/jush/modules/jush.js"></script>
<script src="../externals/jush/modules/jush-textarea.js"></script>
<script src="../externals/jush/modules/jush-txt.js"></script>
<script src="../externals/jush/modules/jush-js.js"></script>
<?php
echo script_src("../externals/jush/modules/jush.js");
echo script_src("../externals/jush/modules/jush-textarea.js");
echo script_src("../externals/jush/modules/jush-txt.js");
echo script_src("../externals/jush/modules/jush-js.js");
if (support("sql")) {
echo script_src("../externals/jush/modules/jush-$jush.js");
?>
<script src="../externals/jush/modules/jush-<?php echo $jush; ?>.js"></script>
<script>
<?php
if ($tables) {

View File

@@ -22,8 +22,8 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<meta name="robots" content="noindex">
<title><?php echo $title_page; ?></title>
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css">
<script src="../adminer/static/functions.js"></script>
<script src="static/editing.js"></script>
<?php echo script_src("../adminer/static/functions.js"); ?>
<?php echo script_src("static/editing.js"); ?>
<?php if ($adminer->head()) { ?>
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico">
<link rel="apple-touch-icon" href="../adminer/static/favicon.ico">

View File

@@ -90,6 +90,14 @@ function script($source, $trailing = "\n") {
return "<script>$source</script>$trailing";
}
/** Return <script src> element
* @param string
* @return string
*/
function script_src($url) {
return "<script src='" . h($url) . "'></script>\n";
}
/** Escape for HTML
* @param string
* @return string