close($fh);
}
-print "Content-type: text/html\n\n";
+print "Content-type: text/html; charset=UTF-8\n\n";
if($method eq 'HEAD') {
exit;
}
}
}
-# print "content-type: text/plain\n\n";
-
$ID = get_id( \%cgi);
$password = get_password(\%cgi);
print 'Content-length: '.$file_info[7]."\n";
}
}
-print 'Content-type: '.$file_data{'content-type'}."\n";
-print 'Content-disposition: attachment; filename="'.$file_name.'"'."\n";
+if ($file_data{'content-type'} ne '') {
+ print 'Content-type: '.$file_data{'content-type'}."\n";
+}
+if ($file_name ne '') {
+ print 'Content-disposition: inline; filename="'.$file_name.'"'."\n";
+}
unless ($direct) {
unless (binmode STDOUT) {
close($fh);
);
}
-print "Content-type: text/plain\n";
+print "Content-type: text/plain; charset=UTF-8\n";
if(!$access) {
print "Status: 403 Forbidden\n";
}
{'path' => CGI_PATH()},
{'path' => $frame_file}
);
-my $content = bb_to_bbcode(eval_bb($frame_data{'content'}, 1));
+my $content = bb_to_bbcode(
+ eval_bb(
+ $frame_data{'content'},
+ 1
+ )
+);
print '[quote][center][size=200]'.$frame_data{'title'}.'[/size]'."\n";
print '[url='.$viewer_url.'][img]'.$frame_url.'[/img][/url][/center]'."\n";
}
sub eval_bb {
- (my $bb, my $full_url) = @_;
+ (my $bb, my $full_url, my $password) = @_;
my $value;
my $before;
my $after;
else {
$value = '';
}
+ if (($value ne '') && ($password ne '')) {
+ $value = merge_url(
+ $value,
+ {'query' => {'p' => $password}}
+ );
+ }
$bb = $before . $value . $after;
}
return $bb;
print $fh '[quote][center][size=200]'.$_title.'[/size]<br>'."\n";
print $fh '[url='.$_viewer_full_url.'][img]'.$_frame_full_url.'[/img][/url][/center]<br>'."\n";
- print $fh html_encode_line(bb_to_bbcode(eval_bb($frame_data->{'content'}, 1)));
+ print $fh html_encode_line(
+ bb_to_bbcode(
+ eval_bb(
+ $frame_data->{'content'},
+ 1
+ )
+ )
+ );
print $fh '[/quote]'."\n";
print $fh ' </div>'."\n";
}
elsif ($frame_data->{'content'} ne '') {
print $fh ' <div id="undertext">'."\n";
- print $fh bb_to_html(eval_bb($frame_data->{'content'}), 0)."\n";
+ print $fh bb_to_html(
+ eval_bb(
+ $frame_data->{'content'},
+ 0,
+ $password_ok ? $settings->{'password'} : ''
+ )
+ )."\n";
print $fh ' </div>'."\n";
}
print $fh ' </div>'."\n";
print $fh ' </div>'."\n";
print $fh ' <div class="opomba_text">'."\n";
- print $fh bb_to_html(eval_bb($post_data{'content'}), 0)."\n";
+ print $fh bb_to_html(
+ eval_bb(
+ $post_data{'content'},
+ 0,
+ $password_ok ? $settings->{'password'} : ''
+ )
+ )."\n";
print $fh ' </div>'."\n";
print $fh ' </div>'."\n";
print $fh ' <br>'."\n";
}
}
-print "Content-type: text/html\n\n";
+print "Content-type: text/html; charset=UTF-8\n\n";
if($method eq 'HEAD') {
exit;
}
if (my @file_info = stat_encoded($frame_path)){
print 'Content-length: '.$file_info[7]."\n";
}
-print 'Content-type: '.$frame_data{'content-type'}."\n";
+if ($frame_data{'content-type'} ne '') {
+ print 'Content-type: '.$frame_data{'content-type'}."\n";
+}
unless (binmode STDOUT) {
close($fh);
exit fail_500("Can't switch output to binary mode.");
$password_ok = ($password eq $settings{'password'});
$password_query = url_query_encode({'p', $settings{'password'}});
-print "Content-type: text/html\n";
+print "Content-type: text/html; charset=UTF-8\n";
print "\n";
if($method eq 'HEAD') {
exit;
$state{'ip3'} = 1;
}
}
- print "Content-type: text/plain\n\n";
+ print "Content-type: text/plain; charset=UTF-8\n\n";
if ($method eq 'HEAD') {
exit;
}
$info_data{'frame'} = sprintf($settings{'frame'}, $frame, $info_data{'ext'});
}
-print "Content-type: text/plain\n";
+print "Content-type: text/plain; charset=UTF-8\n";
if (!$access) {
print "Status: 403 Forbidden\n";
}
return redirect ($method, $return_url, 303);
}
- print "Content-type: text/html\n";
+ print "Content-type: text/html; charset=UTF-8\n";
if ($status ne '') {
print 'Status: '.$status."\n";
}
print ' Preview:'."\n";
print ' </div>'."\n";
print ' <div class="opomba_text">'."\n";
- print bb_to_html(eval_bb($content, 0))."\n";
+ print bb_to_html(
+ eval_bb(
+ $content,
+ 0,
+ $password_ok ? $settings{'password'} : ''
+ )
+ )."\n";
print ' </div>'."\n";
print ' </div>'."\n";
}
1, # as list
);
-print "Content-type: text/html\n";
+print "Content-type: text/html; charset=UTF-8\n";
if(!$access) {
print "Status: 403 Forbidden\n";
}