X7ROOT File Manager
Current Path:
/home/cbholdings/pasukulu/lib/htmlpurifier/HTMLPurifier
home
/
cbholdings
/
pasukulu
/
lib
/
htmlpurifier
/
HTMLPurifier
/
📁
..
📄
Arborize.php
(2.49 KB)
📄
AttrCollections.php
(4.75 KB)
📁
AttrDef
📄
AttrDef.php
(5.07 KB)
📁
AttrTransform
📄
AttrTransform.php
(1.94 KB)
📄
AttrTypes.php
(3.67 KB)
📄
AttrValidator.php
(6.42 KB)
📄
Bootstrap.php
(4.5 KB)
📄
CSSDefinition.php
(19.13 KB)
📁
ChildDef
📄
ChildDef.php
(1.52 KB)
📄
Config.php
(30.96 KB)
📁
ConfigSchema
📄
ConfigSchema.php
(5.76 KB)
📄
ContentSets.php
(5.51 KB)
📄
Context.php
(2.57 KB)
📄
Definition.php
(1.33 KB)
📁
DefinitionCache
📄
DefinitionCache.php
(3.82 KB)
📄
DefinitionCacheFactory.php
(3.13 KB)
📄
Doctype.php
(1.54 KB)
📄
DoctypeRegistry.php
(4.13 KB)
📄
ElementDef.php
(7.35 KB)
📄
Encoder.php
(25.19 KB)
📁
EntityLookup
📄
EntityLookup.php
(1.39 KB)
📄
EntityParser.php
(9.75 KB)
📄
ErrorCollector.php
(7.45 KB)
📄
ErrorStruct.php
(1.85 KB)
📄
Exception.php
(177 B)
📁
Filter
📄
Filter.php
(1.59 KB)
📄
Generator.php
(10.01 KB)
📄
HTMLDefinition.php
(17.33 KB)
📁
HTMLModule
📄
HTMLModule.php
(9.96 KB)
📄
HTMLModuleManager.php
(15.57 KB)
📄
IDAccumulator.php
(1.61 KB)
📁
Injector
📄
Injector.php
(8.79 KB)
📁
Language
📄
Language.php
(5.92 KB)
📄
LanguageFactory.php
(6.46 KB)
📄
Length.php
(3.8 KB)
📁
Lexer
📄
Lexer.php
(13.22 KB)
📁
Node
📄
Node.php
(1.25 KB)
📄
PercentEncoder.php
(3.48 KB)
📁
Printer
📄
Printer.php
(5.76 KB)
📄
PropertyList.php
(2.72 KB)
📄
PropertyListIterator.php
(894 B)
📄
Queue.php
(1.51 KB)
📁
Strategy
📄
Strategy.php
(762 B)
📄
StringHash.php
(1.07 KB)
📄
StringHashParser.php
(3.56 KB)
📁
TagTransform
📄
TagTransform.php
(1.07 KB)
📁
Token
📄
Token.php
(2.17 KB)
📄
TokenFactory.php
(3.03 KB)
📄
URI.php
(10.35 KB)
📄
URIDefinition.php
(3.35 KB)
📁
URIFilter
📄
URIFilter.php
(2.31 KB)
📄
URIParser.php
(2.24 KB)
📁
URIScheme
📄
URIScheme.php
(3.4 KB)
📄
URISchemeRegistry.php
(2.35 KB)
📄
UnitConverter.php
(9.89 KB)
📁
VarParser
📄
VarParser.php
(5.85 KB)
📄
VarParserException.php
(157 B)
📄
Zipper.php
(4.34 KB)
Editing: Language.php
<?php /** * Represents a language and defines localizable string formatting and * other functions, as well as the localized messages for HTML Purifier. */ class HTMLPurifier_Language { /** * ISO 639 language code of language. Prefers shortest possible version. * @type string */ public $code = 'en'; /** * Fallback language code. * @type bool|string */ public $fallback = false; /** * Array of localizable messages. * @type array */ public $messages = array(); /** * Array of localizable error codes. * @type array */ public $errorNames = array(); /** * True if no message file was found for this language, so English * is being used instead. Check this if you'd like to notify the * user that they've used a non-supported language. * @type bool */ public $error = false; /** * Has the language object been loaded yet? * @type bool * @todo Make it private, fix usage in HTMLPurifier_LanguageTest */ public $_loaded = false; /** * @type HTMLPurifier_Config */ protected $config; /** * @type HTMLPurifier_Context */ protected $context; /** * @param HTMLPurifier_Config $config * @param HTMLPurifier_Context $context */ public function __construct($config, $context) { $this->config = $config; $this->context = $context; } /** * Loads language object with necessary info from factory cache * @note This is a lazy loader */ public function load() { if ($this->_loaded) { return; } $factory = HTMLPurifier_LanguageFactory::instance(); $factory->loadLanguage($this->code); foreach ($factory->keys as $key) { $this->$key = $factory->cache[$this->code][$key]; } $this->_loaded = true; } /** * Retrieves a localised message. * @param string $key string identifier of message * @return string localised message */ public function getMessage($key) { if (!$this->_loaded) { $this->load(); } if (!isset($this->messages[$key])) { return "[$key]"; } return $this->messages[$key]; } /** * Retrieves a localised error name. * @param int $int error number, corresponding to PHP's error reporting * @return string localised message */ public function getErrorName($int) { if (!$this->_loaded) { $this->load(); } if (!isset($this->errorNames[$int])) { return "[Error: $int]"; } return $this->errorNames[$int]; } /** * Converts an array list into a string readable representation * @param array $array * @return string */ public function listify($array) { $sep = $this->getMessage('Item separator'); $sep_last = $this->getMessage('Item separator last'); $ret = ''; for ($i = 0, $c = count($array); $i < $c; $i++) { if ($i == 0) { } elseif ($i + 1 < $c) { $ret .= $sep; } else { $ret .= $sep_last; } $ret .= $array[$i]; } return $ret; } /** * Formats a localised message with passed parameters * @param string $key string identifier of message * @param array $args Parameters to substitute in * @return string localised message * @todo Implement conditionals? Right now, some messages make * reference to line numbers, but those aren't always available */ public function formatMessage($key, $args = array()) { if (!$this->_loaded) { $this->load(); } if (!isset($this->messages[$key])) { return "[$key]"; } $raw = $this->messages[$key]; $subst = array(); $generator = false; foreach ($args as $i => $value) { if (is_object($value)) { if ($value instanceof HTMLPurifier_Token) { // factor this out some time if (!$generator) { $generator = $this->context->get('Generator'); } if (isset($value->name)) { $subst['$'.$i.'.Name'] = $value->name; } if (isset($value->data)) { $subst['$'.$i.'.Data'] = $value->data; } $subst['$'.$i.'.Compact'] = $subst['$'.$i.'.Serialized'] = $generator->generateFromToken($value); // a more complex algorithm for compact representation // could be introduced for all types of tokens. This // may need to be factored out into a dedicated class if (!empty($value->attr)) { $stripped_token = clone $value; $stripped_token->attr = array(); $subst['$'.$i.'.Compact'] = $generator->generateFromToken($stripped_token); } $subst['$'.$i.'.Line'] = $value->line ? $value->line : 'unknown'; } continue; } elseif (is_array($value)) { $keys = array_keys($value); if (array_keys($keys) === $keys) { // list $subst['$'.$i] = $this->listify($value); } else { // associative array // no $i implementation yet, sorry $subst['$'.$i.'.Keys'] = $this->listify($keys); $subst['$'.$i.'.Values'] = $this->listify(array_values($value)); } continue; } $subst['$' . $i] = $value; } return strtr($raw, $subst); } } // vim: et sw=4 sts=4
Upload File
Create Folder