X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fplugin.php;h=d5bceafdea82406e6b9ff770e647d325bfcbd50e;hb=69afe503453ab19d6d5137301f9ed9c5f210ca46;hp=1ce13139fbeac4bf935ba481016995af771f43a8;hpb=d810b21f8722190754cb5b9a0cb27896b8648dae;p=friendica.git diff --git a/include/plugin.php b/include/plugin.php index 1ce13139fb..d5bceafdea 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -6,6 +6,7 @@ */ use Friendica\App; +use Friendica\Core\System; /** * @brief uninstalls an addon. @@ -121,8 +122,7 @@ function reload_plugins() { * @return boolean */ function plugin_enabled($plugin) { - $r = dba::select('addon', array('id'), array('installed' => true, 'name' => $plugin), array('limit' => 1)); - return ((dbm::is_result($r)) && (count($r) > 0)); + return dba::exists('addon', array('installed' => true, 'name' => $plugin)); } @@ -402,10 +402,10 @@ function get_theme_screenshot($theme) { $exts = array('.png','.jpg'); foreach ($exts as $ext) { if (file_exists('view/theme/' . $theme . '/screenshot' . $ext)) { - return(App::get_baseurl() . '/view/theme/' . $theme . '/screenshot' . $ext); + return(System::baseUrl() . '/view/theme/' . $theme . '/screenshot' . $ext); } } - return(App::get_baseurl() . '/images/blank.png'); + return(System::baseUrl() . '/images/blank.png'); } // install and uninstall theme @@ -545,6 +545,8 @@ function upgrade_bool_message($bbcode = false) { * @return string Path to the file or empty string if the file isn't found */ function theme_include($file, $root = '') { + $file = basename($file); + // Make sure $root ends with a slash / if it's not blank if ($root !== '' && $root[strlen($root)-1] !== '/') { $root = $root . '/';