Skip to content

Commit e016edc

Browse files
authored
Fix code logic in admin controllers (joomla#45037)
1 parent 76918b0 commit e016edc

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

administrator/components/com_banners/src/Controller/BannerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function allowAdd($data = [])
7171
*/
7272
protected function allowEdit($data = [], $key = 'id')
7373
{
74-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
74+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
7575
$categoryId = 0;
7676

7777
if ($recordId) {

administrator/components/com_categories/src/Controller/CategoryController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ protected function allowAdd($data = [])
9191
*/
9292
protected function allowEdit($data = [], $key = 'parent_id')
9393
{
94-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
94+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
9595
$user = $this->app->getIdentity();
9696

9797
// Check "edit" permission on record asset (explicit or inherited)

administrator/components/com_contact/src/Controller/ContactController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected function allowAdd($data = [])
6363
*/
6464
protected function allowEdit($data = [], $key = 'id')
6565
{
66-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
66+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
6767

6868
// Since there is no asset tracking, fallback to the component permissions.
6969
if (!$recordId) {

administrator/components/com_content/src/Controller/ArticleController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ protected function allowAdd($data = [])
159159
*/
160160
protected function allowEdit($data = [], $key = 'id')
161161
{
162-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
162+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
163163
$user = $this->app->getIdentity();
164164

165165
// Zero record (id:0), return component edit permission by calling parent controller method

administrator/components/com_fields/src/Controller/FieldController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ protected function allowAdd($data = [])
9595
*/
9696
protected function allowEdit($data = [], $key = 'id')
9797
{
98-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
98+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
9999
$user = $this->app->getIdentity();
100100

101101
// Zero record (id:0), return component edit permission by calling parent controller method

administrator/components/com_fields/src/Controller/GroupController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ protected function allowAdd($data = [])
117117
*/
118118
protected function allowEdit($data = [], $key = 'parent_id')
119119
{
120-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
120+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
121121
$user = $this->app->getIdentity();
122122

123123
// Zero record (parent_id:0), return component edit permission by calling parent controller method

administrator/components/com_modules/src/Controller/ModuleController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ protected function allowSave($data, $key = 'id')
141141
protected function allowEdit($data = [], $key = 'id')
142142
{
143143
// Initialise variables.
144-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
144+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
145145

146146
// Zero record (id:0), return component edit permission by calling parent controller method
147147
if (!$recordId) {

administrator/components/com_newsfeeds/src/Controller/NewsfeedController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected function allowAdd($data = [])
6868
*/
6969
protected function allowEdit($data = [], $key = 'id')
7070
{
71-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
71+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
7272

7373
// Since there is no asset tracking, fallback to the component permissions.
7474
if (!$recordId) {

components/com_contact/src/Controller/ContactController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ protected function allowAdd($data = [])
344344
*/
345345
protected function allowEdit($data = [], $key = 'id')
346346
{
347-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
347+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
348348

349349
if (!$recordId) {
350350
return false;

components/com_content/src/Controller/ArticleController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ protected function allowAdd($data = [])
124124
*/
125125
protected function allowEdit($data = [], $key = 'id')
126126
{
127-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
127+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
128128
$user = $this->app->getIdentity();
129129

130130
// Zero record (id:0), return component edit permission by calling parent controller method

0 commit comments

Comments
 (0)