Skip to content
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(core): Fix undefined "application" array key error #50081

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Pytal
Copy link
Member

@Pytal Pytal commented Jan 7, 2025

Summary

Fixes Undefined array key "application" being logged

Checklist

@Pytal Pytal added bug 3. to review Waiting for reviews labels Jan 7, 2025
@Pytal Pytal added this to the Nextcloud 31 milestone Jan 7, 2025
@Pytal Pytal requested review from skjnldsv and a team January 7, 2025 22:16
@Pytal Pytal self-assigned this Jan 7, 2025
@Pytal Pytal requested review from provokateurin and come-nc and removed request for a team January 7, 2025 22:16
@joshtrichards
Copy link
Member

Here too maybe?

p(!empty($_['pageTitle']) && $_['pageTitle'] !== $_['application'] ? $_['pageTitle'] . ' - ' : '');

Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isset() would be more corrext

@blizzz blizzz mentioned this pull request Jan 8, 2025
@@ -10,7 +10,7 @@
<meta charset="utf-8">
<title>
<?php
p(!empty($_['pageTitle']) && $_['pageTitle'] !== $_['application'] ? $_['pageTitle'] . ' - ' : '');
p(!empty($_['pageTitle']) && !empty($_['application']) && $_['pageTitle'] !== $_['application'] ? $_['pageTitle'] . ' - ' : '');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this will hide pageTitle if application is not set, which is not what we want?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
p(!empty($_['pageTitle']) && !empty($_['application']) && $_['pageTitle'] !== $_['application'] ? $_['pageTitle'] . ' - ' : '');
p(!empty($_['pageTitle']) && (empty($_['application']) || $_['pageTitle'] !== $_['application']) ? $_['pageTitle'] . ' - ' : '');

Maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants