Skip to content

Commit ffa47ff

Browse files
vranaclaude
andcommitted
Link editing.js also from an entry point outside the project directory
The path was relative to the URL of the entry point, which works for adminer/index.php and editor/index.php but not for tests/elastic.php, tests/sqlite.php and tests/plugins.php, where it pointed to tests/. The file was not loaded there, so syntaxHighlighting() and loginDriver() were missing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 9ced5a1 commit ffa47ff

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

adminer/include/design.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s
4646

4747
echo script_src(DIR . "static/functions.js");
4848
if (defined('Adminer\DIR')) { // the compiled version merges editing.js into functions.js
49-
echo script_src("static/editing.js");
49+
// Editor has its own version of the file in its own directory, which is the working directory of every entry point
50+
echo script_src(str_replace("adminer/", basename(getcwd()) . "/", DIR) . "static/editing.js");
5051
}
5152
if (adminer()->head($dark)) {
5253
echo "<link rel='icon' href='data:image/gif;base64,"

0 commit comments

Comments
 (0)