[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 01 Oct 2002 07:59:33 -0000


albertel		Tue Oct  1 03:59:33 2002 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - I think the last of the defined checks for BUG#166 
  
  - BUG#631, no more stupid 
  
  Wed Aug  7 15:34:29 2002 (20999): Subscribe returned not_found:
  /home/httpd/html/res/annarbor/.meta
  
  or
  
  
  Wed Aug  7 15:34:29 2002 (20999): Subscribe returned not_found:
  /adm/logout.meta
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.287 loncom/lonnet/perl/lonnet.pm:1.288
--- loncom/lonnet/perl/lonnet.pm:1.287	Tue Oct  1 03:09:05 2002
+++ loncom/lonnet/perl/lonnet.pm	Tue Oct  1 03:59:33 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.287 2002/10/01 07:09:05 albertel Exp $
+# $Id: lonnet.pm,v 1.288 2002/10/01 07:59:33 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2763,9 +2763,9 @@
 	    $filename=$ENV{'request.filename'};
 	}
 	my $metadata=&metadata($filename,$spacequalifierrest);
-	if ($metadata) { return $metadata; }
+	if (defined($metadata)) { return $metadata; }
 	$metadata=&metadata($filename,'parameter_'.$spacequalifierrest);
-	if ($metadata) { return $metadata; }
+	if (defined($metadata)) { return $metadata; }
 
 # ------------------------------------------------------------------ Cascade up
 	unless ($space eq '0') {
@@ -2773,11 +2773,11 @@
 	    if ($id) {
 		my $partgeneral=&EXT('resource.'.$part.'.'.$qualifierrest,
 				     $symbparm,$udom,$uname);
-		if ($partgeneral) { return $partgeneral; }
+		if (defined($partgeneral)) { return $partgeneral; }
 	    } else {
 		my $resourcegeneral=&EXT('resource.0.'.$qualifierrest,
 					 $symbparm,$udom,$uname);
-		if ($resourcegeneral) { return $resourcegeneral; }
+		if (defined($resourcegeneral)) { return $resourcegeneral; }
 	    }
 	}
 
@@ -2806,6 +2806,11 @@
     my ($uri,$what,$liburi,$prefix,$depthcount)=@_;
 
     $uri=&declutter($uri);
+    # if it is a non metadata possible uri return quickly
+    if (($uri eq '') || ($uri =~ m|^/*adm/|) || ($uri =~ m|/$|) ||
+	($uri =~ m|/.meta$|)) {
+	return '';
+    }
     my $filename=$uri;
     $uri=~s/\.meta$//;
 #