[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Mon Dec 22 17:05:03 UTC 2003


mwilkinson
Mon Dec 22 12:05:03 EST 2003
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv13432/Perl/MOBY

Modified Files:
	Central.pm 
Log Message:
added some sanity checking to the authURI attribute of all register* calls.  Its still allows some insanity through, but not the most obviously sick ones

moby-live/Perl/MOBY Central.pm,1.116,1.117
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -r1.116 -r1.117
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2003/12/02 01:08:24	1.116
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2003/12/22 17:05:03	1.117
@@ -234,6 +234,8 @@
 		if ($term =~ /FAILED/){return &_error("Malformed XML;","");}
 		return &_error("Malformed XML; may be missing required parameters objectType, Description, authURI or contactEmail","");
 	}
+	return &_error("Malformed authURI - must not have an http:// prefix","") if $AuthURI =~ '[/:]';
+
 	# validate that the final ontology will be valid by testing against existing relationships and such
 	while (my ($reltype, $obj) = each %{$relationships}){
 		my ($success, $message, $URI) = $RelOntologyServer->relationshipExists(term => $reltype, ontology => 'object'); # success = 1 if it does
@@ -466,6 +468,8 @@
 		if ($term =~ /FAILED/){		return &_error("Malformed XML\n $term","");}
 		return &_error("Malformed XML\n may be missing required parameters serviceType, Description, authURI or contactEmail","");
 	}
+	return &_error("Malformed authURI - must not have an http:// prefix","") if $AuthURI =~ '[/:]';
+
 	# validate that the final ontology will be valid
 
 	my ($exists, $exists_message, $existingURI) = $OntologyServer->serviceExists(term => $term); # success = 1 if it does
@@ -678,6 +682,7 @@
 	unless (defined $term && defined $desc && defined $auth && defined $email){
 		return &_error("Malformed XML; may be missing required parameters namespaceType, Description, authURI or contactEmail","");
 	}
+	return &_error("Malformed authURI - must not have an http:// prefix","") if $AuthURI =~ '[/:]';
 
 	my ($exists, $exists_message, $URI) = $OntologyServer->namespaceExists(term => $term); # success = 1 if it does
 	(($exists==1) && return &_error("Namespace $term already exists", $URI));




More information about the MOBY-guts mailing list