Skip to content

Commit

Permalink
Ensure non ambiguity of sci_names #186 (#187)
Browse files Browse the repository at this point in the history
* Ensure non ambiguity of sci_names

* Use direct comparison

* Apply same logic to eng_name
  • Loading branch information
alexbelgium authored Sep 13, 2024
1 parent b181723 commit 0248964
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function get_com_en_name($sci_name) {
}
$engname = null;
foreach ($_labels_flickr as $label) {
if (strpos($label, $sci_name) !== false) {
if (trim(explode("_", $label)[0]) === $sci_name) {
$engname = trim(explode("_", $label)[1]);
break;
}
Expand All @@ -109,7 +109,7 @@ function get_sci_name($com_name) {
}
$sciname = null;
foreach ($_labels as $label) {
if (strpos($label, $com_name) !== false) {
if (trim(explode("_", $label)[1]) === $com_name) {
$sciname = trim(explode("_", $label)[0]);
break;
}
Expand Down

0 comments on commit 0248964

Please sign in to comment.