Diff for /loncom/xml/lonxml.pm between versions 1.494.4.4 and 1.494.4.5

version 1.494.4.4, 2010/02/11 20:44:15 version 1.494.4.5, 2010/10/01 14:21:55
Line 1523  SIMPLECONTENT Line 1523  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.494.4.4  
changed lines
  Added in v.1.494.4.5


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