Skip to content
Browse files

BUGFIX Type checking in CMS URL params (fixes #7187)

Nasty issue where nested requests to sub-controllers within LeftAndMain->EditForm() would fail because of
LeftAndMain->currentPageID() being taken from the URL, even though it was a field action name.
Example: POST /admin/pages/edit/EditForm/field/MyGridField/item/1/ItemEditForm/field/MyUploadField/upload
The current ID would be detected as "field" in this case.
Bug was previously fixed for AssetAdmin.
  • Loading branch information...
1 parent 3e7bf77 commit ba9c3c7b8e7c8f62e319d3cdb5cc4490b7a62f3b @chillu chillu committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 admin/code/LeftAndMain.php
2 admin/code/LeftAndMain.php
@@ -1170,7 +1170,7 @@ function getSilverStripeNavigator() {
* @return int
public function currentPageID() {
- if($this->request->requestVar('ID')) {
+ if($this->request->requestVar('ID') && is_numeric($this->request->requestVar('ID'))) {
return $this->request->requestVar('ID');
} elseif (isset($this->urlParams['ID']) && is_numeric($this->urlParams['ID'])) {
return $this->urlParams['ID'];

0 comments on commit ba9c3c7

Please sign in to comment.
Something went wrong with that request. Please try again.