Rush has submitted this change and it was merged.

Change subject: * don't use mysqlnd * show an error if the cross-reference for 
bug# is not found in database
......................................................................


* don't use mysqlnd
* show an error if the cross-reference for bug# is not found in database

Change-Id: I923d70197a5be01d01d500d89310691dc45eabf6
---
M modules/phabricator/templates/preamble.php.erb
1 file changed, 7 insertions(+), 4 deletions(-)

Approvals:
  Rush: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/phabricator/templates/preamble.php.erb 
b/modules/phabricator/templates/preamble.php.erb
index 4440e69..571ac88 100644
--- a/modules/phabricator/templates/preamble.php.erb
+++ b/modules/phabricator/templates/preamble.php.erb
@@ -63,13 +63,16 @@
           $stmt = $this->mysqli->prepare($this->config->query);
           $stmt->bind_param('ss', $this->config->fieldIndex, $fieldValue );
           $stmt->execute();
-
-          if ($res = $stmt->get_result()) {
-            $res = $res->fetch_assoc();
+          $stmt->bind_result($task_id);
+          if ($stmt->fetch()) {
             // insert the cross referenced id into the redirectUrl
-            $redirect = str_replace('$id', $res['id'], $p->redirectUrl);
+            $redirect = str_replace('$id', $task_id, $p->redirectUrl);
             // dynamic redirect:
             $this->redirect_and_exit($redirect);
+          } else {
+            error_log('redirector: could not find task for '.$fieldValue);
+            echo 'Task not found for '.$fieldValue;
+            exit(404);
           }
         } else {
           $redirect = $p->redirectUrl;

-- 
To view, visit https://gerrit.wikimedia.org/r/175302
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I923d70197a5be01d01d500d89310691dc45eabf6
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: 20after4 <[email protected]>
Gerrit-Reviewer: Rush <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to