Commit dd081fa2 authored by sikeda's avatar sikeda
Browse files

[-dev] (con'd r10699) Kill more indirect method calls.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@10703 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent fa8eace8
......@@ -1861,12 +1861,12 @@ sub _crash_handler {
my $query;
 
if ($Conf::Conf{'use_fast_cgi'}) {
$query = new CGI::Fast;
$query = CGI::Fast->new;
$loop_count++;
}else {
return undef if ($loop > 1);
 
$query = new CGI;
$query = CGI->new;
}
 
return $query;
......@@ -3803,7 +3803,7 @@ sub do_sso_login_succeeded {
timeout => $ldap->{'timeout'} );
 
unless($mesg->count() != 0) {
wwslog('notice','No entry in the Ldap Directory Tree of %s for %s',$ldap->{'host'},$auth);
wwslog('notice','No entry in the LDAP Directory Tree of %s for %s',$ldap->{'host'},$auth);
$ds->disconnect();
last;
}
......@@ -6088,7 +6088,7 @@ sub do_copy_template {
if ($in{'scope_out'} eq 'list') {
if ($in{'list_out'}) {
my $list_out;
unless ($list_out = new List $in{'list_out'}, $robot) {
unless ($list_out = List->new($in{'list_out'}, $robot)) {
report::reject_report_web('user','unknown_list',{'list' => $in{'list_out'}},$param->{'action'},'');
wwslog('info','do_copy_template: unknown list %s', $in{'list_out'});
web_db_log({'parameters' => $in{'list_out'},
......@@ -8092,7 +8092,7 @@ sub do_arc {
if ($arc =~ /^(\d)+$/) {
my %msg_info;
 
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
my $arc_file = $arc_month_path.'/'.$arc;
......@@ -8519,7 +8519,7 @@ sub do_remove_arc {
## Access control
return undef unless (defined check_authz('do_arcsearch', 'web_archive.access'));
 
my $search = new Marc::Search;
my $search = Marc::Search->new;
$search->search_base (Conf::get_robot_conf($robot, 'arc_path') . '/' . $list->get_list_id());
$search->base_href (Conf::get_robot_conf($robot, 'wwsympa_url') . '/arc/' . $param->{'list'});
$search->archive_name ($in{'archive_name'});
......@@ -8654,7 +8654,7 @@ sub do_remove_arc {
## Access control
return undef unless (defined check_authz('do_arcsearch_id', 'web_archive.access'));
 
my $search = new Marc::Search;
my $search = Marc::Search->new;
$search->search_base (Conf::get_robot_conf($robot, 'arc_path') . '/' . $list->get_list_id());
$search->base_href (Conf::get_robot_conf($robot, 'wwsympa_url') . '/arc/' . $param->{'list'});
 
......@@ -10246,7 +10246,7 @@ sub do_edit_list {
 
 
## Reload config to clean some empty entries in $list->{'admin'}
$list = new List $list->{'name'}, $robot, {'reload_config' => 1};
$list = List->new($list->{'name'}, $robot, {'reload_config' => 1});
 
unless (defined $list) {
report::reject_report_web('intern','list_reload',{},$param->{'action'},'',$param->{'user'}{'email'},$robot);
......@@ -16443,7 +16443,7 @@ sub do_send_mail {
}
 
my $parser;
unless ($parser = new MIME::Parser) {
unless ($parser = MIME::Parser->new) {
report::reject_report_web('intern','cannot_parse_message',{'file' => $filename},$param->{'action'},$list,$param->{'user'}{'email'},$robot);
wwslog('notice', 'Cannot parse message %s', $filename);
return undef;
......
......@@ -39,7 +39,7 @@ sub rfc1891 {
local $/ = "\n";
my $nbrcpt;
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
my $entity = $parser->read($fic);
......
......@@ -2345,7 +2345,7 @@ sub reject {
}
my $msg;
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
unless ($msg = $parser->read(\*IN)) {
......@@ -2369,7 +2369,7 @@ sub reject {
}
my $message;
$parser = new MIME::Parser;
$parser = MIME::Parser->new;
$parser->output_to_core(1);
unless ($message = $parser->read(\*IN)) {
Log::do_log('notice', 'Commands::reject(): Unable to parse message');
......
......@@ -1930,7 +1930,7 @@ sub send_msg_digest {
$text[$i] .= "\n";
}
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
$parser->extract_uuencode(1);
$parser->extract_nested_messages(1);
......@@ -3648,7 +3648,7 @@ sub add_parts {
}
} else {
## MIME footer/header
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
if ($eff_type =~ /^multipart\/alternative/i ||
......@@ -6543,7 +6543,7 @@ sub _include_users_remote_file {
## WebAgent package is part of Fetch.pm and inherites from LWP::UserAgent
my $fetch = WebAgent->new (agent => 'Sympa/'. Sympa::Constants::VERSION);
my $fetch = WebAgent->new(agent => 'Sympa/'. Sympa::Constants::VERSION);
my $req = HTTP::Request->new(GET => $url);
......@@ -9652,7 +9652,7 @@ sub _save_list_config_file {
return undef;
}
my $config = '';
my $fd = new IO::Scalar \$config;
my $fd = IO::Scalar->new(\$config);
foreach my $c (@{$self->{'admin'}{'comment'}}) {
$fd->print(sprintf "%s\n", $c);
......@@ -10234,7 +10234,7 @@ sub _urlize_part {
close TMP;
open BODY, "$expl/$dir/$filename.$encoding";
my $decoder = new MIME::Decoder $encoding;
my $decoder = MIME::Decoder->new($encoding);
$decoder->decode(\*BODY, \*OFILE);
unlink "$expl/$dir/$filename.$encoding";
}else {
......@@ -10256,7 +10256,7 @@ sub _urlize_part {
(my $file_name = $filename) =~ s/\./\_/g;
my $file_url = "$wwsympa_url/attach/$listname".tools::escape_chars("$dir/$filename",'/'); # do NOT escape '/' chars
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
my $new_part;
......
......@@ -39,6 +39,7 @@ package Message;
use strict;
use warnings;
use Mail::Address;
use MIME::Charset;
use MIME::EncWords;
use MIME::Parser;
......@@ -142,7 +143,7 @@ sub new {
return $message;
}
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
my $msg;
......
......@@ -39,6 +39,7 @@ package admin;
use strict;
use warnings;
use File::Copy;
use IO::Scalar;
use Conf;
use Sympa::Constants;
......@@ -288,7 +289,7 @@ sub create_list_old{
}
## Use an intermediate handler to encode to filesystem_encoding
my $config = '';
my $fd = new IO::Scalar \$config;
my $fd = IO::Scalar->new(\$config);
tt2::parse_tt2($param, 'config.tt2', $fd, $tt2_include_path);
# Encode::from_to($config, 'utf8', $Conf::Conf{'filesystem_encoding'});
print $lock_fh $config;
......
......@@ -96,7 +96,7 @@ sub get_mac {
my $md5 = new Digest::MD5;
my $md5 = Digest::MD5->new;
$md5->reset;
$md5->add($email.$secret);
......
......@@ -1091,7 +1091,7 @@ sub reformat_message($;$$) {
my $defcharset = shift;
my $msg;
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
unless (defined $parser) {
Log::do_log('err', "mail::reformat_message: Failed to create MIME parser");
return undef;
......
......@@ -34,7 +34,9 @@ use Encode::MIME::Header; # for 'MIME-Q' encoding
use File::Copy::Recursive;
use File::Find;
use HTML::StripScripts::Parser;
use MIME::Decoder;
use MIME::Lite::HTML;
use MIME::Parser;
use POSIX qw();
use Proc::ProcessTable;
use Scalar::Util '1.22'; # looks_like_number() works.
......@@ -860,7 +862,7 @@ sub remove_invalid_dkim_signature {
my ($header_as_string, $body_as_string) = split("\n\n",$msg_as_string,2);
unless (tools::dkim_verifier($msg_as_string)){
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
my $entity = $parser->parse_data($msg_as_string);
unless($entity) {
......@@ -1036,7 +1038,7 @@ sub smime_sign {
unlink ($temporary_pwd);
}
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
unless ($signed_msg = $parser->read(\*NEWMSG)) {
......@@ -1312,7 +1314,7 @@ sub smime_encrypt {
## Get as MIME object
open (NEWMSG, $temporary_file);
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
unless ($cryptedmsg = $parser->read(\*NEWMSG)) {
Log::do_log('notice', 'Unable to parse message');
......@@ -1428,7 +1430,7 @@ sub smime_decrypt {
unlink ($temporary_file) unless ($main::options{'debug'}) ;
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
unless ($decryptedmsg = $parser->parse_data($msg_as_string)) {
Log::do_log('notice', 'Unable to parse message');
......@@ -1871,7 +1873,7 @@ sub split_mail {
open BODY, "$dir/$pathname.$fileExt.$encoding";
my $decoder = new MIME::Decoder $encoding;
my $decoder = MIME::Decoder->new($encoding);
unless (defined $decoder) {
Log::do_log('err', 'Cannot create decoder for %s', $encoding);
return undef;
......@@ -3624,7 +3626,7 @@ sub md5_fingerprint {
return undef unless (defined $input_string);
chomp $input_string;
my $digestmd5 = new Digest::MD5;
my $digestmd5 = Digest::MD5->new;
$digestmd5->reset;
$digestmd5->add($input_string);
return (unpack("H*", $digestmd5->digest));
......@@ -4026,7 +4028,7 @@ sub create_html_part_from_web_page {
sub get_children_processes_list {
Log::do_log('debug3','');
my @children;
for my $p (@{new Proc::ProcessTable->table}){
for my $p (@{Proc::ProcessTable->new->table}){
if($p->ppid == $$) {
push @children, $p->pid;
}
......
......@@ -38,9 +38,11 @@ use lib '--modulesdir--';
use strict;
use warnings;
use Getopt::Long;
use MIME::Parser;
use Pod::Usage;
use POSIX;
use Bounce;
use Conf;
use Sympa::Constants;
use List;
......@@ -244,7 +246,7 @@ while (!$end) {
});
next;
}
my $parser = new MIME::Parser;
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
my $entity = $parser->read(\*BOUNCE);
my $head = $entity->head;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment