Fix header() parsing

This commit is contained in:
Jamie Cameron
2009-06-05 20:31:09 +00:00
parent 374269ff08
commit 47ecc70230

View File

@@ -317,7 +317,14 @@ sub cgi_page_title
local ($m, $cgi) = @_;
local $data = &read_file_contents(&module_root_directory($m)."/".$cgi);
local $rv;
if ($data =~ /(header|ui_print_header|ui_print_unbuffered_header)\([^,]+,[^,]*(\$text{'([^']+)'|\$text{"([^"]+)"|\&text\('([^']+)'|\&text\("([^"]+)")/) {
if ($data =~ /(ui_print_header|ui_print_unbuffered_header)\([^,]+,[^,]*(\$text{'([^']+)'|\$text{"([^"]+)"|\&text\('([^']+)'|\&text\("([^"]+)")/) {
# New header function, with arg before title
local $msg = $3 || $4 || $5 || $6;
local %mtext = &load_language($m);
$rv = $mtext{$msg};
}
elsif ($data =~ /(^|\s)header\(\s*(\$text{'([^']+)'|\$text{"([^"]+)"|\&text\('([^']+)'|\&text\("([^"]+)")/) {
# Old header function
local $msg = $3 || $4 || $5 || $6;
local %mtext = &load_language($m);
$rv = $mtext{$msg};