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

Fixing a few PHP Warnings #193

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

LouisOuellet
Copy link

Providing some quick fix on some of the PHP Warnings I have in my server log.

@LouisOuellet
Copy link
Author

These fixes also covers issue#178 and issue#177

@@ -34,7 +34,7 @@ function handle_start(Doku_Event $event) {
}

global $_GET;
if($_GET['force_rev']) {
if(isset($_GET['force_rev']) && $_GET['force_rev']) {
Copy link
Member

Choose a reason for hiding this comment

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

The proper fix would be to the $INPUT class here

Copy link
Author

Choose a reason for hiding this comment

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

Which essentially means in the DokuWiki Core right? So unnecessary here.

}
if (isset($meta['date']['modified'])) {
return $meta['date']['modified'];
}
Copy link
Member

Choose a reason for hiding this comment

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

This could be simplified using the ?? operator

Copy link
Author

Choose a reason for hiding this comment

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

That is true :D

@@ -320,7 +325,7 @@ function isHiddenForUser($id = null) {
return auth_quickaclcheck($id) < AUTH_EDIT;
}

if (!$_SERVER['REMOTE_USER']) {
if (!isset($_SERVER['REMOTE_USER'])) {
Copy link
Member

Choose a reason for hiding this comment

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

Again a case for $INPUT->server

Copy link
Author

Choose a reason for hiding this comment

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

To be fair, I didn't know about the Input Class, I'll have to review the class then

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

Successfully merging this pull request may close these issues.

2 participants