1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-05 13:47:24 +02:00

[2.0.1] Add severity to error collector

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1226 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-06-24 23:20:35 +00:00
parent 58064592ff
commit 7b087c7bbe
7 changed files with 59 additions and 21 deletions

View File

@@ -20,6 +20,11 @@ class HTMLPurifier_Language
*/
var $messages = array();
/**
* Array of localizable error codes
*/
var $errorNames = array();
/**
* Has the language object been loaded yet?
* @private
@@ -51,6 +56,18 @@ class HTMLPurifier_Language
return $this->messages[$key];
}
/**
* Retrieves a localised error name.
* @param $int integer error number, corresponding to PHP's error
* reporting
* @return string localised message
*/
function getErrorName($int) {
if (!$this->_loaded) $this->load();
if (!isset($this->errorNames[$int])) return "[Error: $int]";
return $this->errorNames[$int];
}
/**
* Formats a localised message with passed parameters
* @param $key string identifier of message