Skip to content

Commit 8ad7a77

Browse files
oliverkleeSam Tuke
authored andcommitted
[BUGFIX] Make the exception codes 32-bit safe (#100)
1 parent b5068e7 commit 8ad7a77

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
2222
### Removed
2323

2424
### Fixed
25+
- Make the exception codes 32-bit safe (#100)
2526
- Always truncate the DB tables after an integration test (#86)
2627

2728
### Security

src/Controller/SessionController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function postAction(Request $request): View
6161
$request->get('password')
6262
);
6363
if ($administrator === null) {
64-
throw new UnauthorizedHttpException('', 'Not authorized', null, 1500567098798);
64+
throw new UnauthorizedHttpException('', 'Not authorized', null, 1500567098);
6565
}
6666

6767
$token = $this->createAndPersistToken($administrator);
@@ -81,10 +81,10 @@ public function postAction(Request $request): View
8181
private function validateCreateRequest(Request $request)
8282
{
8383
if ($request->getContent() === '') {
84-
throw new BadRequestHttpException('Empty JSON data', null, 1500559729794);
84+
throw new BadRequestHttpException('Empty JSON data', null, 1500559729);
8585
}
8686
if (empty($request->get('login_name')) || empty($request->get('password'))) {
87-
throw new BadRequestHttpException('Incomplete credentials', null, 1500562647846);
87+
throw new BadRequestHttpException('Incomplete credentials', null, 1500562647);
8888
}
8989
}
9090

src/Controller/SubscriberController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function postAction(Request $request): View
5757

5858
$email = $request->get('email');
5959
if ($this->subscriberRepository->findOneByEmail($email) !== null) {
60-
throw new ConflictHttpException('This resource already exists.', null, 1513439108942);
60+
throw new ConflictHttpException('This resource already exists.', null, 1513439108);
6161
}
6262

6363
$subscriber = new Subscriber();
@@ -97,7 +97,7 @@ private function validateSubscriber(Request $request)
9797
throw new UnprocessableEntityHttpException(
9898
'Some fields invalid:' . implode(', ', $invalidFields),
9999
null,
100-
1513446736452
100+
1513446736
101101
);
102102
}
103103
}

src/Controller/Traits/AuthenticationTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private function requireAuthentication(Request $request)
3737
throw new AccessDeniedHttpException(
3838
'No valid session key was provided as basic auth password.',
3939
null,
40-
1512749701851
40+
1512749701
4141
);
4242
}
4343
}

0 commit comments

Comments
 (0)