瀏覽代碼

Added a line to remove special characters from the OBO file. The Cell Ontology had a special character that caused the loader to fail

spficklin 13 年之前
父節點
當前提交
9a0ffbe8d5
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      tripal_cv/obo_loader.php

+ 5 - 0
tripal_cv/obo_loader.php

@@ -529,8 +529,13 @@ function tripal_cv_obo_parse($obo_file,&$obo,&$header){
 
 
       // remove newlines
       // remove newlines
       $line = rtrim($line);  
       $line = rtrim($line);  
+
+      // remove any special characters that may be hiding
+      $line = preg_replace('/[^(\x20-\x7F)]*/','', $line);
+
       // skip empty lines
       // skip empty lines
       if(strcmp($line,'')==0) { continue; }
       if(strcmp($line,'')==0) { continue; }
+
       //remove comments from end of lines
       //remove comments from end of lines
       $line = preg_replace('/^(.*?)\!.*$/','\1',$line);  // TODO: if the explamation is escaped
       $line = preg_replace('/^(.*?)\!.*$/','\1',$line);  // TODO: if the explamation is escaped