mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-10-31 18:47:33 +08:00 
			
		
		
		
	Fixes #17152: Fixed error page when using traceline option
This commit is contained in:
		 Sergei Sergeev
					Sergei Sergeev
				
			
				
					committed by
					
						 Alexander Makarov
						Alexander Makarov
					
				
			
			
				
	
			
			
			 Alexander Makarov
						Alexander Makarov
					
				
			
						parent
						
							0cbd1c12bc
						
					
				
				
					commit
					a7276f6b72
				
			| @ -9,6 +9,7 @@ Yii Framework 2 Change Log | ||||
| - Bug #17133: Fixed aliases rendering during help generation for a console command (GHopperMSK) | ||||
| - Bug #17185: Fixed `AssetManager` timestamp appending when a file is published manually (GHopperMSK) | ||||
| - Bug #17156: Fixes PHP 7.2 warning when a data provider has no data as a parameter for a GridView (evilito) | ||||
| - Bug #17152: Fixed error page when using traceline option (asamats) | ||||
| - Bug #17083: Fixed `yii\validators\EmailValidator::$checkDNS` tells that every domain is correct on alpine linux (mikk150) | ||||
| - Bug #17180: Do not populate `yii\web\Response::$response` when response code is 204 (mikk150) | ||||
| - Bug #17124: Fixed ErrorException when run `./yii fixture/unload` without arguments (ricpelo) | ||||
|  | ||||
| @ -9,6 +9,12 @@ | ||||
| /* @var $end int */ | ||||
| /* @var $args array */ | ||||
| /* @var $handler \yii\web\ErrorHandler */ | ||||
| $html = <<<HTML | ||||
| IDE | ||||
| <svg class="icon icon--new-window" focusable="false" aria-hidden="true" width="16" height="16"> | ||||
|     <use href="#new-window"></use> | ||||
| </svg> | ||||
| HTML; | ||||
| ?> | ||||
| <li class="<?= ($index === 1 || !$handler->isCoreFile($file)) ? 'application' : '' ?> call-stack-item" | ||||
|     data-line="<?= (int) ($line - $begin) ?>"> | ||||
| @ -16,6 +22,10 @@ | ||||
|         <div class="element"> | ||||
|             <span class="item-number"><?= (int) $index ?>.</span> | ||||
|             <span class="text"><?= $file !== null ? 'in ' . $handler->htmlEncode($file) : '' ?></span> | ||||
|             <?php if ($handler->traceLine !== '{html}'): ?> | ||||
|                 <span> – </span> | ||||
|                 <?= strtr($handler->traceLine, ['{file}' => $file, '{line}' => $line + 1, '{html}' => $html]) ?> | ||||
|             <?php endif; ?> | ||||
|             <span class="at"> | ||||
|                 <?= $line !== null ? 'at line' : '' ?> | ||||
|                 <span class="line"><?= $line !== null ? $line + 1 : '' ?></span> | ||||
| @ -34,14 +44,12 @@ | ||||
|             <?php for ($i = $begin; $i <= $end; ++$i): ?><div class="hover-line"></div><?php endfor; ?> | ||||
|             <div class="code"> | ||||
|                 <?php for ($i = $begin; $i <= $end; ++$i): ?><span class="lines-item"><?= (int) ($i + 1) ?></span><?php endfor; ?> | ||||
|                 <pre> | ||||
|                     <?php | ||||
|                 <pre><?php | ||||
|                     // fill empty lines with a whitespace to avoid rendering problems in opera | ||||
|                     for ($i = $begin; $i <= $end; ++$i) { | ||||
|                         echo (trim($lines[$i]) === '') ? " \n" : strtr($handler->traceLine, ['{file}' => $file, '{line}' => $i + 1, '{html}' => $handler->htmlEncode($lines[$i])]); | ||||
|                         echo (trim($lines[$i]) === '') ? " \n" : $handler->htmlEncode($lines[$i]); | ||||
|                     } | ||||
|                     ?> | ||||
|                 </pre> | ||||
|                     ?></pre> | ||||
|             </div> | ||||
|         </div> | ||||
|     <?php endif; ?> | ||||
|  | ||||
| @ -381,6 +381,14 @@ body.mousedown pre { | ||||
| </head> | ||||
|  | ||||
| <body> | ||||
|     <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" display="none"> | ||||
|         <symbol id="new-window" viewBox="0 0 24 24"> | ||||
|             <g transform="scale(0.0234375 0.0234375)"> | ||||
|                 <path d="M598 128h298v298h-86v-152l-418 418-60-60 418-418h-152v-86zM810 810v-298h86v298c0 46-40 86-86 86h-596c-48 0-86-40-86-86v-596c0-46 38-86 86-86h298v86h-298v596h596z"></path> | ||||
|             </g> | ||||
|         </symbol> | ||||
|     </svg> | ||||
|  | ||||
|     <div class="header"> | ||||
|         <div class="tools"> | ||||
|             <textarea id="clipboard"><?= $handler->htmlEncode($exception) ?></textarea> | ||||
| @ -487,7 +495,11 @@ window.onload = function() { | ||||
|         refreshCallStackItemCode(callStackItems[i]); | ||||
|  | ||||
|         // toggle code block visibility | ||||
|         callStackItems[i].getElementsByClassName('element-wrap')[0].addEventListener('click', function() { | ||||
|         callStackItems[i].getElementsByClassName('element-wrap')[0].addEventListener('click', function(event) { | ||||
|             if (event.target.nodeName.toLowerCase() === 'a') { | ||||
|                 return; | ||||
|             } | ||||
|  | ||||
|             var callStackItem = this.parentNode, | ||||
|                 code = callStackItem.getElementsByClassName('code-wrap')[0]; | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user