|  |  |  | @ -51,6 +51,7 @@ class ErrorHandler extends Component | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** | 
			
		
	
		
			
				
					|  |  |  |  | 	 * Handles exception | 
			
		
	
		
			
				
					|  |  |  |  | 	 * @param \Exception $exception | 
			
		
	
		
			
				
					|  |  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |  | 	public function handle($exception) | 
			
		
	
	
		
			
				
					|  |  |  | @ -64,6 +65,10 @@ class ErrorHandler extends Component | 
			
		
	
		
			
				
					|  |  |  |  | 		$this->renderException($exception); | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** | 
			
		
	
		
			
				
					|  |  |  |  | 	 * Renders exception | 
			
		
	
		
			
				
					|  |  |  |  | 	 * @param \Exception $exception | 
			
		
	
		
			
				
					|  |  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |  | 	protected function renderException($exception) | 
			
		
	
		
			
				
					|  |  |  |  | 	{ | 
			
		
	
		
			
				
					|  |  |  |  | 		if ($this->errorAction !== null) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -196,6 +201,10 @@ class ErrorHandler extends Component | 
			
		
	
		
			
				
					|  |  |  |  | 		echo '<div class="code"><pre>' . $output . '</pre></div>'; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** | 
			
		
	
		
			
				
					|  |  |  |  | 	 * Renders calls stack trace | 
			
		
	
		
			
				
					|  |  |  |  | 	 * @param array $trace | 
			
		
	
		
			
				
					|  |  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |  | 	public function renderTrace($trace) | 
			
		
	
		
			
				
					|  |  |  |  | 	{ | 
			
		
	
		
			
				
					|  |  |  |  | 		$count = 0; | 
			
		
	
	
		
			
				
					|  |  |  | @ -233,6 +242,11 @@ class ErrorHandler extends Component | 
			
		
	
		
			
				
					|  |  |  |  | 		echo '</table>'; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** | 
			
		
	
		
			
				
					|  |  |  |  | 	 * Converts special characters to HTML entities | 
			
		
	
		
			
				
					|  |  |  |  | 	 * @param string $text text to encode | 
			
		
	
		
			
				
					|  |  |  |  | 	 * @return string | 
			
		
	
		
			
				
					|  |  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |  | 	public function htmlEncode($text) | 
			
		
	
		
			
				
					|  |  |  |  | 	{ | 
			
		
	
		
			
				
					|  |  |  |  | 		return htmlspecialchars($text, ENT_QUOTES, \Yii::$app->charset); | 
			
		
	
	
		
			
				
					|  |  |  | 
 |