<?php // encoding: utf-8 $o = new weeXHTMLEncoder(); // weeXHTMLEncoder::encode $this->isEqual('win', $o->encode('win'), _WT('weeXHTMLEncoder::encode should return its argument untouched if it does not contain any special character.')); $this->isEqual("Time to say 'night.", $o->encode("Time to say 'night."), _WT("weeXHTMLEncoder::encode should return any single quote character untouched.")); $this->isEqual('">_>" & "<_<" & "è_é"', $o->encode('">_>" & "<_<" & "è_é"'), _WT('weeXHTMLEncoder::encode should return the expected encoded value.')); $this->isEqual('東方妖々夢', $o->encode('東方妖々夢'), _WT('weeXHTMLEncoder::encode should not encode Unicode characters.')); // weeXHTMLEncoder::decode $this->isEqual('win', $o->decode('win'), _WT('weeXHTMLEncoder::decode should return its argument untouched if it does not contain any XHTML entity.')); $this->isEqual('">_>" & "<_<" & "è_é"', $o->decode('">_>" & "<_<" & "è_é"'), _WT('weeXHTMLEncoder::decode should return the expected decoded value.'));
/** Delete all buffers and print the error page. If no page was defined using weeException::setErrorPage, the default error page is shown. @param $aDebug An array containing debugging information about the error or the exception. */ public static function printErrorPage($aDebug) { while (ob_get_level()) { ob_end_clean(); } // Try to set headers to sane values if (!headers_sent()) { header('Content-Type: text/html'); header('Content-Disposition: inline'); header('Content-Encoding: identity'); } if (empty(self::$sErrorPagePath)) { self::$sErrorPagePath = ROOT_PATH . 'res/wee/error.htm'; } // Encode the debug array for XHTML $oEncoder = new weeXHTMLEncoder(); $aDebug = $oEncoder->encodeArray($aDebug); require self::$sErrorPagePath; }