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!~/(?:\<|\<\;)(?:html|xml)[^\<]*(?:\>|\>\;)/is) { |
my ($is_html,$is_xml); |
return &mt('File does not have [_1] or [_2] starting tag','<html>','<xml>'); |
if ($filecontents =~/(?:\<|\<\;)\?xml[^\<]*\?(?:\>|\>\;)/is) { |
|
$is_xml = 1; |
|
} elsif ($filecontents =~/(?:\<|\<\;)html(?:\s+[^\<]+|\s*)[^\<]*(?:\>|\>\;)/is) { |
|
$is_html = 1; |
} |
} |
if ($filecontents!~/(?:\<|\<\;)\/(?:html|xml)(?:\>|\>\;)/is) { |
unless ($is_xml || $is_html) { |
return &mt('File does not have [_1] or [_2] ending tag','<html>','<xml>'); |
return &mt('File does not have [_1] or [_2] starting tag','<html>','<?xml ?>'); |
} |
} |
if ($filecontents!~/(?:\<|\<\;)(?:body|frameset)[^\<]*(?:\>|\>\;)/is) { |
if ($is_html) { |
return &mt('File does not have [_1] or [_2] starting tag','<body>','<frameset>'); |
if ($filecontents!~/(?:\<|\<\;)\/html(?:\>|\>\;)/is) { |
} |
return &mt('File does not have [_1] ending tag','<html>'); |
if ($filecontents!~/(?:\<|\<\;)\/(?:body|frameset)[^\<]*(?:\>|\>\;)/is) { |
} |
return &mt('File does not have [_1] or [_2] ending tag','<body>','<frameset>'); |
if ($filecontents!~/(?:\<|\<\;)(?:body|frameset)[^\<]*(?:\>|\>\;)/is) { |
|
return &mt('File does not have [_1] or [_2] starting tag','<body>','<frameset>'); |
|
} |
|
if ($filecontents!~/(?:\<|\<\;)\/(?:body|frameset)[^\<]*(?:\>|\>\;)/is) { |
|
return &mt('File does not have [_1] or [_2] ending tag','<body>','<frameset>'); |
|
} |
} |
} |
return ''; |
return ''; |
} |
} |