diff --git a/index.php b/index.php index 8e8d9c3..bc68b7e 100644 --- a/index.php +++ b/index.php @@ -11,6 +11,11 @@ if (strlen($inchi) === 0) { $inchi = "InChI=1/CH4/h1H4"; } + if (strlen($inchi) < 8 || + (substr($inchi, 0,8) != "InChI=1/" && + substr($inchi, 0,9) != "InChI=1S/")) { + $inchi = "InChI=1/CH4/h1H4"; + } ?> - + diff --git a/rdf_module_chebi.php b/rdf_module_chebi.php index 7888c69..d8a8175 100644 --- a/rdf_module_chebi.php +++ b/rdf_module_chebi.php @@ -13,6 +13,11 @@ if (strlen($inchi) === 0) { $inchi = "InChI=1/CH4/h1H4"; } + if (strlen($inchi) < 8 || + (substr($inchi, 0,8) != "InChI=1/" && + substr($inchi, 0,9) != "InChI=1S/")) { + $inchi = "InChI=1/CH4/h1H4"; + } ?>