about summary refs log tree commit diff
path: root/sourcecodes
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-10-03 07:07:51 +0000
committerPjotr <wrk@bosa.lan>2026-10-03 07:07:51 +0000
commit3616c9642dcd111c9256a47ee46f9805af49be06 (patch)
tree621c693423b2180c4dddc423e5eb98e114169ccf /sourcecodes
parent4dd78e7bd2bbde84a316c12f7d985edc62afcbb9 (diff)
downloadgn-bnw-3616c9642dcd111c9256a47ee46f9805af49be06.tar.gz
bn_genenet: accept the GN2 template spelling My_Genenet
GN2's bnw_page.html posts the payload field as "My_Genenet" (one 'n'
in Genenet), while BNW historically read "My_Gennenet" -- the two
never matched, so GN2's POST arrived empty and BNW showed its default
form (the "Loading data from GeneNetwork" hang).  Accept both
spellings.

New test t18b posts My_Genenet through the legacy /sourcecodes/ action
path the template uses.  Suite with BNW_LOCAL_SOURCE (this checkout):
26/26.
Diffstat (limited to 'sourcecodes')
-rw-r--r--sourcecodes/bn_genenet.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/sourcecodes/bn_genenet.php b/sourcecodes/bn_genenet.php
index ae7364d7..64caf82b 100644
--- a/sourcecodes/bn_genenet.php
+++ b/sourcecodes/bn_genenet.php
@@ -55,9 +55,15 @@ if(isset($_POST["searchkey"]))
 // separators, semicolons are row separators.  Convert server-side --
 // the previous release echoed the raw payload into a JavaScript
 // string, which is an XSS hole on public deployments.
-if(isset($_POST["My_Gennenet"]))
+// NOTE: GN2's bnw_page.html posts the field as "My_Genenet" while
+// earlier integrations used "My_Gennenet" -- accept both spellings.
+$gn2_payload = NULL;
+foreach (array("My_Gennenet", "My_Genenet") as $gn2_field)
+   if(isset($_POST[$gn2_field]))
+      $gn2_payload = $_POST[$gn2_field];
+if(!is_null($gn2_payload))
 {
-   $searchID = str_replace(',', "\t", $_POST['My_Gennenet']);
+   $searchID = str_replace(',', "\t", $gn2_payload);
    $searchID = str_replace(';', "\n", $searchID);
 }