-
Notifications
You must be signed in to change notification settings - Fork 35
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
base: master
Are you sure you want to change the base?
Conversation
…hp on line 37 by verifying if the key exist
…114 by verifying if is null
…n line 323 by verifying if the key exist
… of the key 'date'.'modified' and returning 0 if nothing is found
@@ -34,7 +34,7 @@ function handle_start(Doku_Event $event) { | |||
} | |||
|
|||
global $_GET; | |||
if($_GET['force_rev']) { | |||
if(isset($_GET['force_rev']) && $_GET['force_rev']) { |
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.
The proper fix would be to the $INPUT class here
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.
Which essentially means in the DokuWiki Core right? So unnecessary here.
} | ||
if (isset($meta['date']['modified'])) { | ||
return $meta['date']['modified']; | ||
} |
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.
This could be simplified using the ??
operator
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.
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'])) { |
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.
Again a case for $INPUT->server
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.
To be fair, I didn't know about the Input Class, I'll have to review the class then
Providing some quick fix on some of the PHP Warnings I have in my server log.