Fix docs, add .dockerignore, fix base64url padding, fix typo
- Add .dockerignore to exclude .git, vendor, var, tests, docs, .env and other non-build files from Docker context - Fix broken base64url padding in src/Data/Payload.php: str_pad was a no-op because the length argument was always < string length. Replaced with correct str_repeat approach - Fix typo in bin/franken.sh: digtialadapt → digitaladapt - Add comment to bin/franken.sh noting it's a dev utility - Remove config/reference.php from git tracking (auto-generated file) and add to .gitignore - Fix readme.md: env.example → example.env (matches actual filename)
This commit is contained in:
1 parent
95ab77db2a
commit
6b5a711fa9
6 files changed
+24
-850
No files matched your search
@@ -16,9 +16,9 @@ final class Payload {
|
||||
|
||||
public static function decode(string $base64url): ?Payload {
|
||||
/* convert the base64url into json string */
|
||||
$json = base64_decode(str_pad(strtr($base64url, '-_', '+/'),
|
||||
strlen($base64url) % 4, '='
|
||||
), true);
|
||||
$base64 = strtr($base64url, '-_', '+/');
|
||||
$base64 .= str_repeat('=', (4 - strlen($base64) % 4) % 4);
|
||||
$json = base64_decode($base64, true);
|
||||
if ($json) {
|
||||
/* convert the json string into real data */
|
||||
$data = json_decode($json);
|
||||
|
||||
Reference in new issue
Block a user