Skip to content

Commit

Permalink
(Fixes issue 3096) error while reporting error happens if CHtml is no…
Browse files Browse the repository at this point in the history
…t loaded
  • Loading branch information
mdomba committed Jan 11, 2012
1 parent 0d685d1 commit 0b0e3af
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 14 additions & 8 deletions framework/views/exception.php
Original file line number Diff line number Diff line change
@@ -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[*/
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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>

Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 0b0e3af

Please sign in to comment.