#1009: Shiny exception template produces invalid XHTML
-----------------------+----------------------------------------------------
 Reporter:  MugeSo     |        Owner:  david 
     Type:  defect     |       Status:  closed
 Priority:  normal     |    Milestone:  0.11.6
Component:  exception  |      Version:  0.11.5
 Severity:  minor      |   Resolution:  fixed 
 Keywords:             |    Has_patch:  0     
-----------------------+----------------------------------------------------

Comment(by Ionut Matei <johnu...@…>):

 You can still get invalid XHTML from shiny.php if you get an exception
 inside a php tag prefixed by a new line and one or more spaces, inside a
 view.

 {{{
 <?php
 class Default_Admin_Widgets_MenuSuccessView extends AdsDefaultBaseView
 {
         public function executeHtml(AgaviRequestDataHolder $rd)
         {
                 $this->setupHtml($rd);
                 ob_start();?>duda
  <?php
 throw new Exception();
 ob_end_clean();

         }
 }
 ?>
 }}}

 From what i've seen in shiny.php, at line 615:
 {{{
 if(strpos($line, '</span>') < strpos($line, '<span') || strpos($line,
 '<span') === false) {
 }}}
 checks if the current line has any closing span before a closing one OR
 the current line has no open span tag. If true, it copies the open span
 found in one of the previous lines.

 BUT it does not check if the current line REALLY contains the </span>.
 {{{strpos($line, '</span>')}}} may return {{{false}}} which is less than
 {{{strpos($line, '<span')}}} may return.

 So... a {{{strpos($line, '</span>') !== false}}} must be added.

-- 
Ticket URL: <http://trac.agavi.org/ticket/1009#comment:10>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5



_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets

Reply via email to