Skip to content

Commit

Permalink
Merge pull request #6422 from nhaagen/_8/SCORM/38025
Browse files Browse the repository at this point in the history
SCORM: #38025, check for empty result when checking (Tracking)Permissions
  • Loading branch information
Uwe-Kohnle authored Oct 17, 2023
2 parents ac19467 + 4a37050 commit c7760dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -18,6 +16,8 @@
*
*********************************************************************/

declare(strict_types=1);

/**
* Class ilSCORM2004StoreData
* @author Alex Killing <[email protected]>
Expand Down Expand Up @@ -99,7 +99,7 @@ public static function checkIfAllowed(int $packageId, int $userId, int $hash): v
array($packageId, $userId, date('Y-m-d H:i:s'))
);
$rowtmp = $ilDB->fetchAssoc($res);
if ((int) $rowtmp['hash'] == $hash) {
if ($rowtmp && (int) $rowtmp['hash'] == $hash) {
return;
}

Expand Down
9 changes: 3 additions & 6 deletions Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -18,6 +16,8 @@
*
*********************************************************************/

declare(strict_types=1);

/**
* Class ilObjSCORMTracking
* @author Alex Killing <[email protected]>
Expand Down Expand Up @@ -622,10 +622,7 @@ public static function checkIfAllowed(int $packageId, int $userId, int $hash): v
array($packageId, $userId, date('Y-m-d H:i:s'))
);
$rowtmp = $ilDB->fetchAssoc($res);
if ($rowtmp['hash'] == $hash) {
//ok - do nothing
// die("allowed");
} else {
if (! ($rowtmp && $rowtmp['hash'] == $hash)) {
//output used by api
die("not allowed");
}
Expand Down

0 comments on commit c7760dc

Please sign in to comment.