1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-30 19:00:10 +02:00

[2.0.1] Rather than pass line number by parameter, have it be retrieved via Context. Add $ignore_error boolean to get().

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1228 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-06-25 01:08:57 +00:00
parent 8ae2604440
commit 728088f2ba
5 changed files with 59 additions and 37 deletions

View File

@@ -31,11 +31,14 @@ class HTMLPurifier_Context
/**
* Retrieves a variable reference from the context.
* @param $name String name
* @param $ignore_error Boolean whether or not to ignore error
*/
function &get($name) {
function &get($name, $ignore_error = false) {
if (!isset($this->_storage[$name])) {
trigger_error("Attempted to retrieve non-existent variable $name",
E_USER_ERROR);
if (!$ignore_error) {
trigger_error("Attempted to retrieve non-existent variable $name",
E_USER_ERROR);
}
$var = null; // so we can return by reference
return $var;
}