#115 [Shortener] fix: guard EASYURL_SHOW_QRCODE user conf read (undefined property warning)#116
Open
nicolas-eoxia wants to merge 1 commit into
Open
Conversation
…undefined property warning) EASYURL_SHOW_QRCODE is a per-user setting ($user->conf). It was read directly at two call sites in the shortener object-info table, raising 'Undefined property: stdClass::$EASYURL_SHOW_QRCODE' for any user who never toggled the QR-code switch. Read it through !empty() (which, like isset(), does not warn on a missing property) in both places. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #115
Problem
Rendering the shortener object-info table on a linked element emits:
Warning: Undefined property: stdClass::$EASYURL_SHOW_QRCODE in htdocs/custom/easyurl/class/shortener.class.php on line 525Cause
EASYURL_SHOW_QRCODEis a per-user setting ($user->conf, fromllx_user_param). It was read directly at lines 525 and 544 with no guard, so for any user who never toggled the QR-code switch the property is absent and PHP raises an undefined-property warning.Fix
Read the optional user param through
!empty()(likeisset(), it does not warn on a missing property) at both call sites. Behaviour is unchanged for users who have the switch on/off.php -lpasses.