-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: htmlentities() of values being passed into Group query
- Loading branch information
1 parent
c958368
commit b2dcf5c
Showing
2 changed files
with
57 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
/** | ||
* A script for looking up SmarterU Groups by name. | ||
* | ||
* To use the script, run it from the command line with the group name as the | ||
* first argument. If your group name includes spaces or control characters, | ||
* wrap it in quotes. | ||
* | ||
* Examples: | ||
* php ListUsersLiveTest.php "Group Name" | ||
* php ListUsersLiveTest.php GroupName | ||
* | ||
* The script will render the print_r() version of your group so you can see | ||
* the value of it's properties. | ||
* | ||
* @author CORE Software Team | ||
* @copyright $year$ Core Business Solutions | ||
* @license Proprietary | ||
* @since 2024/12/18 | ||
* @version $version$ | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace CBS\SmarterU\Tests\Usability; | ||
|
||
require_once(__DIR__ . '/../vendor/autoload.php'); | ||
|
||
use CBS\SmarterU\Client; | ||
|
||
$accountKey = getenv('SMARTERU_ACCOUNT_KEY') ?? 'No Account Key Provided'; | ||
$userKey = getenv('SMARTERU_USER_KEY') ?? 'No User Key Provided'; | ||
|
||
/** | ||
* The first argument to the script should be the group name. | ||
* | ||
* @var string|null | ||
*/ | ||
$groupNameToFind = $argv[1] ?? null; | ||
|
||
// If no arguments, then show usage. | ||
if (empty($groupNameToFind)) { | ||
echo "Usage: php ListUsersLiveTest.php [groupName]\n"; | ||
exit(1); | ||
} | ||
|
||
try { | ||
print_r( | ||
(new Client($accountKey, $userKey)) | ||
->readGroupByName($groupNameToFind) | ||
); | ||
} catch (\Exception $error) { | ||
var_dump($error); | ||
} |
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