From 3f4c2ce36d183b39e522ac3b17f9d7e8db19fb70 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 19 Jun 2006 12:46:13 +0200 Subject: js.php fix - correct begin/end comment, plugin filename wasn't being used - add file exists check, to avoid bloating js with comments for non-existent plugin js. Many (most?) plugins don't have javascript. darcs-hash:20060619104613-9b6ab-08a570cdbb0d6441f1caa71766d4c59c73828835.gz --- lib/exe/js.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/exe/js.php b/lib/exe/js.php index 75b9b1f1c..9854f1b45 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -130,9 +130,11 @@ function js_out(){ // load plugin scripts (suppress warnings for missing ones) foreach($plugins as $plugin){ - echo "\n\n/* XXXXXXXXXX begin of $file XXXXXXXXXX */\n\n"; - @readfile($plugin); - echo "\n\n/* XXXXXXXXXX end of $file XXXXXXXXXX */\n\n"; + if (@file_exists($plugin)) { + echo "\n\n/* XXXXXXXXXX begin of $plugin XXXXXXXXXX */\n\n"; + @readfile($plugin); + echo "\n\n/* XXXXXXXXXX end of $plugin XXXXXXXXXX */\n\n"; + } } // load user script -- cgit v1.2.3