Diff for /loncom/imspackages/imsprocessor.pm between versions 1.54.2.1 and 1.55

version 1.54.2.1, 2017/11/16 18:09:59 version 1.55, 2017/05/23 03:07:40
Line 29 Line 29
 package Apache::imsprocessor;  package Apache::imsprocessor;
   
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::loncommon;  
 use Apache::loncleanup;  use Apache::loncleanup;
 use Apache::lonlocal;  use Apache::lonlocal;
 use LWP::UserAgent;  
 use HTTP::Request::Common;  use HTTP::Request::Common;
 use LONCAPA::Configuration;  use LONCAPA::Configuration;
   use LONCAPA::LWPReq;
 use strict;  use strict;
   
 sub ims_config {  sub ims_config {
Line 100  sub create_tempdir { Line 99  sub create_tempdir {
     my ($context,$pathinfo,$timenow) = @_;         my ($context,$pathinfo,$timenow) = @_;   
     my $configvars = &LONCAPA::Configuration::read_conf('loncapa.conf');      my $configvars = &LONCAPA::Configuration::read_conf('loncapa.conf');
     my $tempdir;      my $tempdir;
     $pathinfo = &Apache::loncommon::clean_path($pathinfo);  
 # Collapse dots  
     $pathinfo =~ s/\.+/./g;  
     if ($context eq 'DOCS') {      if ($context eq 'DOCS') {
         $tempdir =  $$configvars{'lonDaemons'}.'/tmp/'.$pathinfo;          $tempdir =  $$configvars{'lonDaemons'}.'/tmp/'.$pathinfo;
         if (!-e "$tempdir") {          if (!-e "$tempdir") {
Line 134  sub uploadzip { Line 130  sub uploadzip {
         $fname=~s/\s+/\_/g;          $fname=~s/\s+/\_/g;
 # Replace all other weird characters by nothing  # Replace all other weird characters by nothing
         $fname=~s/[^\w\.\-]//g;          $fname=~s/[^\w\.\-]//g;
 # Collapse dots  
         $fname=~s/\.+/./g;  
 # See if there is anything left  # See if there is anything left
         unless ($fname) { return 'error: no uploaded file'; }          unless ($fname) { return 'error: no uploaded file'; }
 # Save the file  # Save the file
Line 4963  sub retrieve_image { Line 4957  sub retrieve_image {
     my ($context,$res,$dirname,$cdom,$cname,$docroot,$destdir,$urlpath,$filename) = @_;      my ($context,$res,$dirname,$cdom,$cname,$docroot,$destdir,$urlpath,$filename) = @_;
     my $contents;      my $contents;
     my $url = $urlpath.$filename;      my $url = $urlpath.$filename;
     my $ua=new LWP::UserAgent;      my $lonhost = $Apache::lonnet::perlvar{'lonHostID'};
     my $request=new HTTP::Request('GET',$url);      my $request=new HTTP::Request('GET',$url);
     my $response=$ua->request($request);      my $response=&LONCAPA::LWPReq::makerequest($lonhost,$request);
     if ($response->is_success) {       if ($response->is_success) { 
         $contents = $response->content;          $contents = $response->content;
         if (!-e "$docroot/$res") {          if (!-e "$docroot/$res") {

Removed from v.1.54.2.1  
changed lines
  Added in v.1.55


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>