[aur-dev] [PATCH 4/4] Check return value of get_extended_fields()

Lukas Fleischer lfleischer at archlinux.org
Tue Apr 18 06:52:54 UTC 2017


Make sure that the get_extended_fields() invocation succeeded before
merging regular and extended fields in process_query().

Signed-off-by: Lukas Fleischer <lfleischer at archlinux.org>
---
 web/lib/aurjson.class.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
index e07522d..9eeaafd 100644
--- a/web/lib/aurjson.class.php
+++ b/web/lib/aurjson.class.php
@@ -313,7 +313,10 @@ class AurJSON {
 				}
 
 				if ($this->version >= 2 && ($type == 'info' || $type == 'multiinfo')) {
-					$row = array_merge($row, $this->get_extended_fields($row['ID'], $row['PackageBaseID']));
+					$extfields = $this->get_extended_fields($row['ID'], $row['PackageBaseID']);
+					if ($extfields) {
+						$row = array_merge($row, $extfields);
+					}
 				}
 
 				if ($this->version < 3) {
-- 
2.12.2


More information about the aur-dev mailing list