mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 22:33:10 +09:00
Add list of reserved words #763
This commit is contained in:
parent
fae2a05b6f
commit
97047d1279
6 changed files with 83 additions and 7 deletions
|
|
@ -173,6 +173,11 @@ class Context
|
|||
*/
|
||||
private static $_blacklist = null;
|
||||
|
||||
/**
|
||||
* Reserved words cache
|
||||
*/
|
||||
private static $_reserved = null;
|
||||
|
||||
/**
|
||||
* Singleton instance
|
||||
* @var object
|
||||
|
|
@ -2482,6 +2487,26 @@ class Context
|
|||
return isset(self::$_blacklist[$plugin_name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a word is reserved in Rhymix
|
||||
*
|
||||
* @param string $word
|
||||
* @return bool
|
||||
*/
|
||||
public static function isReservedWord($word)
|
||||
{
|
||||
if (self::$_reserved === null)
|
||||
{
|
||||
self::$_reserved = (include RX_BASEDIR . 'common/defaults/reserved.php');
|
||||
if (!is_array(self::$_reserved))
|
||||
{
|
||||
self::$_reserved = array();
|
||||
}
|
||||
}
|
||||
|
||||
return isset(self::$_reserved[$word]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a local path into an URL
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue