Index: lib/TWiki/Contrib/Publish.pm =================================================================== RCS file: /usr/local/src/cvs_rep/AMPSWEB/twiki/lib/TWiki/Contrib/Publish.pm,v retrieving revision 1.1 diff -w -u -r1.1 Publish.pm --- lib/TWiki/Contrib/Publish.pm 8 Sep 2005 03:18:43 -0000 1.1 +++ lib/TWiki/Contrib/Publish.pm 8 Sep 2005 23:40:04 -0000 @@ -47,7 +47,7 @@ die "Could not configure PublishAddOn: $!" if $!; } -$VERSION = 1.301; +$VERSION = 1.302; # [MILS] update to 1.302 from 1.301 to keep from confusing things # Main rendering loop. sub main { @@ -57,9 +57,10 @@ # Fill in default environment variables if invoked from command-line. $ENV{HTTP_USER_AGENT} = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" unless(exists $ENV{HTTP_USER_AGENT}); + $ENV{HTTP_HOST} = "localhost" unless(exists $ENV{HTTP_HOST}); # [MILS] FIXES THE rsrc BUG!! $ENV{REMOTE_ADDR} = "127.0.0.1" unless(exists $ENV{REMOTE_ADDR}); $ENV{REMOTE_PORT} = "2509" unless(exists $ENV{REMOTE_PORT}); $ENV{REMOTE_USER} = "TWikiGuest" unless(exists $ENV{REMOTE_USER}); @@ -283,6 +284,7 @@ $revuser = TWiki::userToWikiName($revuser); # Handle standard formatting. + $text =~ s/%COMMENT{?.*}?%//go; # [MILS] -remove CommentPlugin comment box -- prevent accidental submission $text = TWiki::Func::expandCommonVariables($text, $topic, $web); $text = TWiki::Func::renderText($text); @@ -292,6 +294,7 @@ $tmpl =~ s/%TEXT%/$text/go; $tmpl =~ s/.*?<\/nopublish>//gos; + $tmpl =~ s///gos; # [MILS] remove input fields from forms -- prevent accidental submission $tmpl =~ s/%MAXREV%/1.$maxrev/go; $tmpl =~ s/%CURRREV%/1.$maxrev/go; $tmpl =~ s/%REVTITLE%//go; @@ -300,10 +303,12 @@ my $ult = getUnsatisfiedLinkTemplate($web); $tmpl =~ s/$ult/$1/g; # Copy files from pub dir to rsrc dir in static dir. - my $pub = '(?:http://localhost)?'.TWiki::Func::getPubUrlPath(); +# my $pub = '(?:http://localhost)?'.TWiki::Func::getPubUrlPath(); # [MILS] FIXES THE rsrc BUG!! + my $pub = "(?:http://$ENV{HTTP_HOST})?".TWiki::Func::getPubUrlPath(); # [MILS] FIXES THE rsrc BUG!! $tmpl =~ s!$pub/([^"']+)!©Resource($web, $1, $copied, $zip)!ge; # Modify internal links. - my $ilt = '(?:http://localhost)?'.$TWiki::dispScriptUrlPath.$TWiki::dispViewPath. $TWiki::scriptSuffix; +# my $ilt = '(?:http://localhost)?'.$TWiki::dispScriptUrlPath.$TWiki::dispViewPath. $TWiki::scriptSuffix; # [MILS] FIXES THE rsrc BUG!! + my $ilt = "(?:http://$ENV{HTTP_HOST})?".$TWiki::dispScriptUrlPath.$TWiki::dispViewPath. $TWiki::scriptSuffix; # [MILS] FIXES THE rsrc BUG!! # link to this web $tmpl =~ s!(href=["'])$ilt/$web/(\w+)!$1$2.html!go; # link to another web