-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: handle undefined cookie value for virtual card expansion, refact… #33048
base: develop
Are you sure you want to change the base?
Conversation
@@ -17,6 +17,7 @@ | |||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | |||
*/ | |||
|
|||
ob_start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use of ob_start lead to difficulty to understand and debug.
We should not need this for common pages.
Can you describe why you need this ?
According to description of bug, only the
$expand = $_COOKIE['virtualcard_expand'] ?? null;
should be required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, there were multiple errors displaying on the virtual card page with headers already sent by the main.inc.php file. It helps prevent "headers already sent" errors by delaying the actual sending of output until the page's ready, allowing to modify headers at any point before the flush.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, there were multiple errors displaying on the virtual card page with headers already sent by the main.inc.php file. It helps prevent "headers already sent" errors by delaying the actual sending of output until the page's ready, allowing to modify headers at any point before the flush.
If we have error "headers already sent", it is better to fix them by not sending data before the header instead of adding a hack to hide it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Maxenor and if multiple errors... fix this errors ! ;-)
Fix "Undefined array key" warning and remove debug output in virtualcard.php
Summary
Replaced direct access to $_COOKIE['virtualcard_expand'] with the null coalescing operator to avoid the "Undefined array key" warning.
Why
Undefined array key warning: Accessing $_COOKIE['virtualcard_expand'] directly triggered a warning if the cookie didn’t exist.
@defrance