Diff for /loncom/xml/lonxml.pm between versions 1.515 and 1.516

version 1.515, 2010/09/29 15:47:21 version 1.516, 2010/09/29 15:53:07
Line 1434  SIMPLECONTENT Line 1434  SIMPLECONTENT
   
 sub verify_html {  sub verify_html {
     my ($filecontents)=@_;      my ($filecontents)=@_;
     if ($filecontents!~/(?:\<|\&lt\;)(?:html|xml)[^\<]*(?:\>|\&gt\;)/is) {      my ($is_html,$is_xml);
        return &mt('File does not have [_1] or [_2] starting tag','&lt;html&gt;','&lt;xml&gt;');      if ($filecontents =~/(?:\<|\&lt\;)\?xml[^\<]*\?(?:\>|\&gt\;)/is) {
           $is_xml = 1;
       } elsif ($filecontents =~/(?:\<|\&lt\;)html(?:\s+[^\<]+|\s*)[^\<]*(?:\>|\&gt\;)/is) {
           $is_html = 1;
     }      }
     if ($filecontents!~/(?:\<|\&lt\;)\/(?:html|xml)(?:\>|\&gt\;)/is) {      unless ($is_xml || $is_html) {
        return &mt('File does not have [_1] or [_2] ending tag','&lt;html&gt;','&lt;xml&gt;');          return &mt('File does not have [_1] or [_2] starting tag','&lt;html&gt;','&lt;?xml ?&gt;');
     }      }
     if ($filecontents!~/(?:\<|\&lt\;)(?:body|frameset)[^\<]*(?:\>|\&gt\;)/is) {      if ($is_html) {
        return &mt('File does not have [_1] or [_2] starting tag','&lt;body&gt;','&lt;frameset&gt;');          if ($filecontents!~/(?:\<|\&lt\;)\/html(?:\>|\&gt\;)/is) {
     }              return &mt('File does not have [_1] ending tag','&lt;html&gt;');
     if ($filecontents!~/(?:\<|\&lt\;)\/(?:body|frameset)[^\<]*(?:\>|\&gt\;)/is) {          }
        return &mt('File does not have [_1] or [_2] ending tag','&lt;body&gt;','&lt;frameset&gt;');          if ($filecontents!~/(?:\<|\&lt\;)(?:body|frameset)[^\<]*(?:\>|\&gt\;)/is) {
               return &mt('File does not have [_1] or [_2] starting tag','&lt;body&gt;','&lt;frameset&gt;');
           }
           if ($filecontents!~/(?:\<|\&lt\;)\/(?:body|frameset)[^\<]*(?:\>|\&gt\;)/is) {
               return &mt('File does not have [_1] or [_2] ending tag','&lt;body&gt;','&lt;frameset&gt;');
           }
     }      }
     return '';      return '';
 }  }

Removed from v.1.515  
changed lines
  Added in v.1.516


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>