mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-03 20:58:11 +02:00
Remove trailing whitespace.
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
@@ -6,50 +6,50 @@
|
||||
*/
|
||||
class HTMLPurifier_Language
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* ISO 639 language code of language. Prefers shortest possible version
|
||||
*/
|
||||
public $code = 'en';
|
||||
|
||||
|
||||
/**
|
||||
* Fallback language code
|
||||
*/
|
||||
public $fallback = false;
|
||||
|
||||
|
||||
/**
|
||||
* Array of localizable messages
|
||||
*/
|
||||
public $messages = array();
|
||||
|
||||
|
||||
/**
|
||||
* Array of localizable error codes
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
public $error = false;
|
||||
|
||||
|
||||
/**
|
||||
* Has the language object been loaded yet?
|
||||
* @todo Make it private, fix usage in HTMLPurifier_LanguageTest
|
||||
*/
|
||||
public $_loaded = false;
|
||||
|
||||
|
||||
/**
|
||||
* Instances of HTMLPurifier_Config and HTMLPurifier_Context
|
||||
*/
|
||||
protected $config, $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
|
||||
@@ -63,7 +63,7 @@ class HTMLPurifier_Language
|
||||
}
|
||||
$this->_loaded = true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves a localised message.
|
||||
* @param $key string identifier of message
|
||||
@@ -74,7 +74,7 @@ class HTMLPurifier_Language
|
||||
if (!isset($this->messages[$key])) return "[$key]";
|
||||
return $this->messages[$key];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves a localised error name.
|
||||
* @param $int integer error number, corresponding to PHP's error
|
||||
@@ -86,7 +86,7 @@ class HTMLPurifier_Language
|
||||
if (!isset($this->errorNames[$int])) return "[Error: $int]";
|
||||
return $this->errorNames[$int];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts an array list into a string readable representation
|
||||
*/
|
||||
@@ -105,7 +105,7 @@ class HTMLPurifier_Language
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Formats a localised message with passed parameters
|
||||
* @param $key string identifier of message
|
||||
@@ -127,7 +127,7 @@ class HTMLPurifier_Language
|
||||
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.'.Compact'] =
|
||||
$subst['$'.$i.'.Serialized'] = $generator->generateFromToken($value);
|
||||
// a more complex algorithm for compact representation
|
||||
// could be introduced for all types of tokens. This
|
||||
@@ -157,6 +157,6 @@ class HTMLPurifier_Language
|
||||
}
|
||||
return strtr($raw, $subst);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user