-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6422 from nhaagen/_8/SCORM/38025
SCORM: #38025, check for empty result when checking (Tracking)Permissions
- Loading branch information
Showing
2 changed files
with
6 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
@@ -18,6 +16,8 @@ | |
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Class ilSCORM2004StoreData | ||
* @author Alex Killing <[email protected]> | ||
|
@@ -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; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
@@ -18,6 +16,8 @@ | |
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Class ilObjSCORMTracking | ||
* @author Alex Killing <[email protected]> | ||
|
@@ -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"); | ||
} | ||
|