Re: [aur-dev][PATCH 0/2] php warning fixes

2020-02-12 Thread Lukas Fleischer
On Wed, 12 Feb 2020 at 21:16:36, Eli Schwartz wrote: > I had this sitting around since December and forgot to send it in, > offered FWIW. It's slightly different in implementation and has more > wordy commit messages. Thanks. I will discard the other patch I submitted earlier (Verify that

[aur-dev][PATCH 1/2] fix php 7.4 warnings

2020-02-12 Thread Eli Schwartz
If a db query returned NULL instead of an array, then accessing $row[0] now throws a warning. The undocumented behavior of evaluating to NULL is maintained, and we want to return NULL anyway, so add a check for the value and fall back on the default function return type. Signed-off-by: Eli

[aur-dev][PATCH 2/2] fix more php 7.4 warnings

2020-02-12 Thread Eli Schwartz
The try_login() function documents it returns an array containing an 'error' key, and our only caller *only* consults the 'error' key. Then the function returns null instead of an array, if the login succeeded! I question why we bother returning the new SID if we never use it, surely we could

[aur-dev][PATCH 0/2] php warning fixes

2020-02-12 Thread Eli Schwartz
I had this sitting around since December and forgot to send it in, offered FWIW. It's slightly different in implementation and has more wordy commit messages. Eli Schwartz (2): fix php 7.4 warnings fix more php 7.4 warnings web/lib/acctfuncs.inc.php | 1 + web/lib/aur.inc.php | 28

[PATCH v2] Verify that returned rows exist before extracting columns

2020-02-12 Thread Lukas Fleischer
Fix PHP notices such as "Trying to access array offset on value of type bool" or "Trying to access array offset on value of type null". Signed-off-by: Lukas Fleischer --- web/html/login.php | 4 +++- web/lib/aur.inc.php | 21 + web/lib/pkgfuncs.inc.php | 3 +++

[PATCH] Verify that return rows exist before extracting columns

2020-02-12 Thread Lukas Fleischer
Signed-off-by: Lukas Fleischer --- web/lib/aur.inc.php | 21 + web/lib/pkgfuncs.inc.php | 3 +++ 2 files changed, 24 insertions(+) diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php index e9530fc..2507df6 100644 --- a/web/lib/aur.inc.php +++ b/web/lib/aur.inc.php