Skip to content

Commit

Permalink
Fix undefined index for user token plugin
Browse files Browse the repository at this point in the history
Closes gh-29591
  • Loading branch information
Nicholas K. Dionysopoulos committed Jun 14, 2020
1 parent 1d97e89 commit beabcd1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/user/token/token.php
Expand Up @@ -171,9 +171,9 @@ public function onContentPrepareData(string $context, &$data): bool
*/
if (($context === 'com_users.profile') && ($this->app->input->get('layout') !== 'edit'))
{
$pluginData = $data->{$this->profileKeyPrefix};
$enabled = $pluginData['enabled'];
$token = $pluginData['token'];
$pluginData = $data->{$this->profileKeyPrefix} ?? [];
$enabled = $pluginData['enabled'] ?? false;
$token = $pluginData['token'] ?? '';

$pluginData['enabled'] = Text::_('JDISABLED');
$pluginData['token'] = '';
Expand Down

0 comments on commit beabcd1

Please sign in to comment.