X-Git-Url: https://git.p6c8.net/selfforum.git/blobdiff_plain/18da3fe7fb9cb4e98596b146df4fe8ba59bcb725..aaff267fdddc495df3bfa2fc0eb0d20a76b6d220:/selfforum-cgi/user/fo_posting.pl diff --git a/selfforum-cgi/user/fo_posting.pl b/selfforum-cgi/user/fo_posting.pl index 6bcde80..91a21a1 100644 --- a/selfforum-cgi/user/fo_posting.pl +++ b/selfforum-cgi/user/fo_posting.pl @@ -104,7 +104,7 @@ sub check_reply_dupe () { $flocked = 1; - ($threads, $last_thread, $last_message, my $unids) = get_all_threads (forum_filename, 1, 0); + ($threads, $last_thread, $last_message, undef, my $unids) = get_all_threads (forum_filename, 1, 0); ($ftid,$fmid) = split /;/,$dparam{$formdata -> {followUp} -> {name}},2; # Thread existiert nicht @@ -327,12 +327,16 @@ sub print_error ($;$) { ################################ sub fetch_subject () { - unless (exists ($dparam{$formdata -> {posterCategory} -> {name}}) and - exists ($dparam{$formdata -> {posterSubject} -> {name}})) { + my %must = map {$_ => 1} @{$formmust -> {exists $dparam{$formdata -> {followUp} -> {name}}?'reply':'new'}}; + + if ( ($must{posterCategory} and not exists ($dparam{$formdata -> {posterCategory} -> {name}})) or + ($must{posterSubject} and not exists ($dparam{$formdata -> {posterSubject} -> {name}}))) + { my $filename = message_path.'t'.$ftid.'.xml'; - if (lock_file ($filename)) { + if (-f $filename and lock_file ($filename)) + { my $xml = new XML::DOM::Parser -> parsefile ($filename); violent_unlock_file($filename) unless unlock_file ($filename); @@ -340,7 +344,9 @@ sub fetch_subject () { my $header = get_message_header ($mnode); $dparam{$formdata -> {posterCategory} -> {name}} = $header -> {category}; - $dparam{$formdata -> {posterSubject} -> {name}} = $header -> {subject};}} + $dparam{$formdata -> {posterSubject} -> {name}} = $header -> {subject}; + } + } } ################################