Skip to content

Commit

Permalink
Plugin API: consistent handling of MantisCore pseudo-plugin
Browse files Browse the repository at this point in the history
- return true and not 1 if we declare return type to be boolean
- plugin_is_installed() returns true for MantisCore since by definition
  it is always installed
  • Loading branch information
dregad committed Jun 2, 2014
1 parent d992cf2 commit da2cdab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/plugin_api.php
Expand Up @@ -558,9 +558,9 @@ function plugin_dependency( $p_base_name, $p_required, $p_initialized = false )
function plugin_protected( $p_base_name ) {
global $g_plugin_cache_protected;

# For pseudo-plugin MantisCore, return protected as 1.
# Pseudo-plugin MantisCore is protected
if( $p_base_name == 'MantisCore' ) {
return 1;
return true;
}

return $g_plugin_cache_protected[$p_base_name];
Expand Down Expand Up @@ -588,6 +588,11 @@ function plugin_priority( $p_base_name ) {
* @return bool True if plugin is installed
*/
function plugin_is_installed( $p_basename ) {
# Pseudo-plugin MantisCore is always installed
if( $p_basename == 'MantisCore' ) {
return true;
}

$t_plugin_table = db_get_table( 'plugin' );

$t_forced_plugins = config_get_global( 'plugins_force_installed' );
Expand Down

0 comments on commit da2cdab

Please sign in to comment.