mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Initial implementation of blacklist function
This commit is contained in:
parent
055fd49e40
commit
e335aa477e
2 changed files with 36 additions and 0 deletions
|
|
@ -157,6 +157,11 @@ class Context
|
|||
*/
|
||||
public $isSuccessInit = TRUE;
|
||||
|
||||
/**
|
||||
* Plugin blacklist cache
|
||||
*/
|
||||
private static $_blacklist = null;
|
||||
|
||||
/**
|
||||
* Singleton instance
|
||||
* @var object
|
||||
|
|
@ -2566,6 +2571,26 @@ class Context
|
|||
return self::$_instance->allow_rewrite;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether an addon, module, or widget is blacklisted
|
||||
*
|
||||
* @param string $plugin_name
|
||||
* @return bool
|
||||
*/
|
||||
public static function isBlacklistedPlugin($plugin_name)
|
||||
{
|
||||
if (self::$_blacklist === null)
|
||||
{
|
||||
self::$_blacklist = (include RX_BASEDIR . 'common/defaults/blacklist.php');
|
||||
if (!is_array(self::$_blacklist))
|
||||
{
|
||||
self::$_blacklist = array();
|
||||
}
|
||||
}
|
||||
|
||||
return isset(self::$_blacklist[$plugin_name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a local path into an URL
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue