@@ -310,7 +310,7 @@ sub alias_for_html {
310
310
if ( $aux_file_id =~ / https?:/ ) { # external link_file
311
311
$resource_object -> uri($aux_file_id ); # no unique id is needed -- external link doc
312
312
$resource_object -> {copy_link }-> {type } = ' external' ;
313
- $resource_object -> {uri }-> {is_accessible } = $self -> check_url( $resource_object -> uri());
313
+ $resource_object -> {uri }{is_accessible } = 1; # Assume a url is accessible.
314
314
return $resource_object -> uri; # external links need no further processing
315
315
} elsif ( $aux_file_id =~ m | ^/| ) {
316
316
$file_path = $aux_file_id ;
@@ -383,7 +383,6 @@ sub alias_for_html {
383
383
# Return full url to image file (resource_id)
384
384
# ###############################################################################
385
385
386
- # $self->debug_message("link created --alias_for_image_html: url is ".$resource_object->uri(). " check =".$self->check_url($resource_object->uri()) );
387
386
$resource_object -> uri(); # return the uri of the resource -- in this case the URL for the file in the temp directory
388
387
}
389
388
@@ -457,7 +456,7 @@ sub alias_for_tex {
457
456
if ( $aux_file_id =~ / https?:/ ) { # external link_file
458
457
$resource_object -> uri($aux_file_id ); # no unique id is needed -- external link doc
459
458
$resource_object -> {copy_link }-> {type } = ' external' ;
460
- $resource_object -> {uri }-> {is_accessible } = $self -> check_url( $resource_object -> uri());
459
+ $resource_object -> {uri }{is_accessible } = 1; # Assume a url is accessible.
461
460
return $resource_object -> uri; # external links need no further processing
462
461
} elsif ( $aux_file_id =~ m | ^/| ) {
463
462
$file_path = $aux_file_id ;
@@ -585,7 +584,7 @@ sub create_link_to_tmp_file {
585
584
$resource_object -> {path }-> {is_accessible } = (-r $linkPath );
586
585
587
586
$resource_object -> uri($resource_uri );
588
- $resource_object -> {uri }-> {is_accessible } = $self -> check_url( $resource_object -> uri());
587
+ $resource_object -> {uri }{is_accessible } = 1; # Assume a url is accessible.
589
588
$resource_object -> {path }-> {is_complete } = 1;
590
589
$resource_object -> {uri }-> {is_complete } = 1;
591
590
} else {
@@ -659,8 +658,6 @@ sub convert_file_to_png_for_tex {
659
658
our ($macrosPath ,
660
659
# ^variable my $pwd
661
660
$pwd ,
662
- # ^variable my $server_root_url
663
- $server_root_url ,
664
661
);
665
662
666
663
# ^function findMacroFile
@@ -692,34 +689,6 @@ sub find_file_in_directories {
692
689
return ; # no file found
693
690
}
694
691
695
-
696
- # ^function check_url
697
- # ^uses %envir
698
- sub check_url {
699
- my $self = shift ;
700
- my $url = shift ;
701
- my $OK_CONSTANT = " 200 OK" ;
702
- return undef if $url =~ / ;/ ; # make sure we can't get a second command in the url
703
- return undef unless $url =~/ \S / ;
704
- # FIXME -- check for other exploits of the system call #FIXME -- ALARM feature so that the response cannot be held up for too long.
705
- # ALARM: /opt/local/bin/lwp-request -d -t 40 -mHEAD ";
706
- # the -t 40 means the call times out after 40 seconds.
707
- # Set this alarm in site.conf
708
- # FIXME doesn't seem to work with relative addresses.
709
- # FIXME Can we get the machine name of the server?
710
- $server_root_url =$self -> envir(" server_root_url" );
711
- $self -> warning_message(" check_url: server_root_url is not defined in site.conf" ) unless $server_root_url ;
712
- unless ($url =~ / ^http/ ) {
713
- # $self->debug_message("check_url: augmenting url $url");
714
- $url = " $server_root_url /$url " ;
715
-
716
- }
717
- my $check_url_command = WeBWorK::PG::IO::externalCommand(' checkurl' );
718
- my $response = ` $check_url_command $url ` ;
719
- # $self->debug_message("check_url: response for url $url is $response");
720
- return ($response =~ / $OK_CONSTANT / ) ? 1 : 0;
721
- }
722
-
723
692
# This is a stub for deprecated problems that call this method. Some of the Geogebra problems that do so actually work
724
693
# even though this method fails.
725
694
sub findAppletCodebase {
0 commit comments