Skip to content

Guard null controller access in EverblockTools shortcode rendering#990

Merged
CySSoO merged 1 commit intomasterfrom
cyssoo/fix-php-warning-in-everblocktools
Mar 4, 2026
Merged

Guard null controller access in EverblockTools shortcode rendering#990
CySSoO merged 1 commit intomasterfrom
cyssoo/fix-php-warning-in-everblocktools

Conversation

@CySSoO
Copy link
Contributor

@CySSoO CySSoO commented Mar 4, 2026

Motivation

  • Prevent a PHP warning when $context->controller is null by avoiding direct access to controller_type in EverblockTools::renderShortcodes().

Description

  • Safely resolve the controller type into $controllerType using is_object($context->controller) and isset($context->controller->controller_type), or assign null otherwise.
  • Only run getCustomerShortcodes() and obfuscateTextByClass() when $controllerType is non-null and in_array($controllerType, $controllerTypes, true), preserving previous behavior for front/modulefront controllers.
  • Change implemented in src/Service/EverblockTools.php.

Testing

  • Ran php -l src/Service/EverblockTools.php and it reported No syntax errors detected.

Codex Task

@CySSoO CySSoO merged commit 70e18ea into master Mar 4, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant