diff options
author | Stefan Giehl <stefan@matomo.org> | 2021-08-16 19:14:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-16 19:14:02 +0300 |
commit | 8c7fa7d8d414b5201c36661fb4828d14e4c33c53 (patch) | |
tree | 95a65fdf0c71dd4c28c78ba7fd7d1620d8892905 /core | |
parent | 331e69eb1f2c022afb943114000aa60a4d93b1ac (diff) |
Fix possible notices (#17886)
* Fix possible notices
* Ensure to query hash for deleted segments
Diffstat (limited to 'core')
-rw-r--r-- | core/DataAccess/Model.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/DataAccess/Model.php b/core/DataAccess/Model.php index 3848c6defa..e6e821e1a6 100644 --- a/core/DataAccess/Model.php +++ b/core/DataAccess/Model.php @@ -632,10 +632,10 @@ class Model private function getDeletedSegmentWhereClause(array $segment) { $idSite = (int)$segment['enable_only_idsite']; - $segmentHash = $segment['hash']; + $segmentHash = $segment['hash'] ?? ''; // Valid segment hashes are md5 strings - just confirm that it is so it's safe for SQL injection if (!ctype_xdigit($segmentHash)) { - throw new Exception($segment . ' expected to be an md5 hash'); + throw new Exception($segmentHash . ' expected to be an md5 hash'); } $nameClause = 'name LIKE "done' . $segmentHash . '%"'; |