diff options
author | Frank Karlitschek <karlitschek@kde.org> | 2012-02-28 16:14:12 +0100 |
---|---|---|
committer | Frank Karlitschek <karlitschek@kde.org> | 2012-02-28 16:14:12 +0100 |
commit | 5e9d268c21ab96e382a9634dcb1e66cb5b6637ff (patch) | |
tree | 83a32a819d6f29db5b9709a9cbb298d7080e32e4 | |
parent | de642697bb6c8bd6d04ca2c946bae2fe63418e23 (diff) | |
download | nextcloud-server-5e9d268c21ab96e382a9634dcb1e66cb5b6637ff.tar.gz nextcloud-server-5e9d268c21ab96e382a9634dcb1e66cb5b6637ff.zip |
never try to load an non existing template,css,img.
do propper checking, error reporting and motivate the developerto fix it ;-)
-rw-r--r-- | lib/helper.php | 5 | ||||
-rw-r--r-- | lib/template.php | 17 |
2 files changed, 18 insertions, 4 deletions
diff --git a/lib/helper.php b/lib/helper.php index fc0b8867703..5b1efd749ae 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -98,8 +98,11 @@ class OC_Helper { return OC::$WEBROOT."/$app/img/$image"; }elseif( file_exists( OC::$SERVERROOT."/themes/$theme/core/img/$image" )){ return OC::$WEBROOT."/themes/$theme/core/img/$image"; - }else{ + }elseif( file_exists( OC::$SERVERROOT."/core/img/$image" )){ return OC::$WEBROOT."/core/img/$image"; + }else{ + echo('image not found: image:'.$image.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT); + die(); } } diff --git a/lib/template.php b/lib/template.php index b79faa9e755..eea2925975c 100644 --- a/lib/template.php +++ b/lib/template.php @@ -197,9 +197,12 @@ class OC_Template{ }elseif( file_exists( OC::$SERVERROOT."/$app/templates/"."$name$fext.php" )){ $template = OC::$SERVERROOT."/$app/templates/"."$name$fext.php"; $path = OC::$SERVERROOT."/$app/templates/"; - }else{ + }elseif( file_exists( OC::$SERVERROOT."/$app/templates/"."$name.php" )){ $template = OC::$SERVERROOT."/$app/templates/"."$name.php"; $path = OC::$SERVERROOT."/$app/templates/"; + }else{ + echo('template not found: template:'.$name.' formfactor:'.$fext.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT); + die(); } } @@ -383,9 +386,13 @@ class OC_Template{ // Is it in core? }elseif(is_file(OC::$SERVERROOT."/core/$script$fext.js" )){ $page->append( "jsfiles", OC::$WEBROOT."/core/$script$fext.js" ); - }else{ + }elseif(is_file(OC::$SERVERROOT."/core/$script.js" )){ $page->append( "jsfiles", OC::$WEBROOT."/core/$script.js" ); + }else{ + echo('js file not found: script:'.$script.' formfactor:'.$fext.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT); + die(); + } } // Add the css files @@ -406,8 +413,12 @@ class OC_Template{ // or in core ? }elseif(is_file(OC::$SERVERROOT."/core/$style$fext.css" )){ $page->append( "cssfiles", OC::$WEBROOT."/core/$style$fext.css" ); - }else{ + }elseif(is_file(OC::$SERVERROOT."/core/$style.css" )){ $page->append( "cssfiles", OC::$WEBROOT."/core/$style.css" ); + + }else{ + echo('css file not found: style:'.$script.' formfactor:'.$fext.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT); + die(); } } // Add the theme css files. you can override the default values here |