Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

(Fixes issue 3096) error while reporting error happens if CHtml is no…

…t loaded
  • Loading branch information...
commit 0b0e3afb74a2194cdfb982f2947f88bd3091e1c5 1 parent 0d685d1
mdomba authored
Showing with 15 additions and 8 deletions.
  1. +1 −0  CHANGELOG
  2. +14 −8 framework/views/exception.php
View
1  CHANGELOG
@@ -7,6 +7,7 @@ Version 1.1.10 work in progress
- Bug: Fixed the bug introduced in 1.1.9 CActiveForm required field was not validated if left empty (mdomba)
- Bug: #3070: Fixed the CACtiveForm JS error if there is no field rendered (mdomba)
- Bug: #3071: Fixed the bug that afterValidateAttribute was not called properly (mdomba)
+- Bug: #3096: Fixed the bug when reporting an error and CHtml is not loaded (mdomba)
- Enh: #3063: Gii, when generating models, tableNames will be checked against reserved PHP keywords when '*' is used (mdomba)
Version 1.1.9 January 1, 2012
View
22 framework/views/exception.php
@@ -1,10 +1,16 @@
+<?php
+ function e($text)
+ {
+ return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);
+ }
+?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<title><?php echo CHtml::encode($data['type'])?></title>
+<title><?php echo e($data['type'])?></title>
<style type="text/css">
/*<![CDATA[*/
@@ -90,9 +96,9 @@
.code pre {
background-color: #ffe;
margin: 0.5em 0;
- padding: 0.5em;
- line-height: 125%;
- border: 1px solid #eee;
+ padding: 0.5em;
+ line-height: 125%;
+ border: 1px solid #eee;
}
.source .file {
@@ -161,11 +167,11 @@
<h1><?php echo $data['type']?></h1>
<p class="message">
- <?php echo nl2br(CHtml::encode($data['message']))?>
+ <?php echo nl2br(e($data['message']))?>
</p>
<div class="source">
- <p class="file"><?php echo CHtml::encode($data['file'])."({$data['line']})"?></p>
+ <p class="file"><?php echo e($data['file'])."({$data['line']})"?></p>
<?php echo $this->renderSourceCode($data['file'],$data['line'],$this->maxSourceLines); ?>
</div>
@@ -195,13 +201,13 @@
<?php endif; ?>
<?php
echo '&nbsp;';
- echo CHtml::encode($trace['file'])."(".$trace['line'].")";
+ echo e($trace['file'])."(".$trace['line'].")";
echo ': ';
if(!empty($trace['class']))
echo "<strong>{$trace['class']}</strong>{$trace['type']}";
echo "<strong>{$trace['function']}</strong>(";
if(!empty($trace['args']))
- echo CHtml::encode($this->argumentsToString($trace['args']));
+ echo e($this->argumentsToString($trace['args']));
echo ')';
?>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.