Skip to content

Commit

Permalink
Use constants when possible
Browse files Browse the repository at this point in the history
Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
  • Loading branch information
Tithugues authored and MauricioFauth committed Jul 17, 2019
1 parent 4447299 commit ae77d63
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libraries/classes/Plugins/Auth/AuthenticationSignon.php
Expand Up @@ -84,7 +84,7 @@ public function setCookieParams(array $sessionCookieParams = null): void
unset($sessionCookieParams['samesite']);
}

if (version_compare(phpversion(), '7.3.0', '>=')) {
if (version_compare(PHP_VERSION, '7.3.0', '>=')) {
session_set_cookie_params($sessionCookieParams);
}

Expand Down
6 changes: 3 additions & 3 deletions libraries/common.inc.php
Expand Up @@ -52,18 +52,18 @@
/**
* block attempts to directly run this script
*/
if (getcwd() == dirname(__FILE__)) {
if (getcwd() == __DIR__) {
die('Attack stopped');
}

/**
* Minimum PHP version; can't call Core::fatalError() which uses a
* PHP 5 function, so cannot easily localize this message.
*/
if (version_compare(PHP_VERSION, '7.1.3', 'lt')) {
if (PHP_VERSION_ID < 70103) {
die(
'PHP 7.1.3+ is required. <br> Currently installed version is: '
. phpversion()
. PHP_VERSION
);
}

Expand Down
2 changes: 1 addition & 1 deletion test/EnvironmentTest.php
Expand Up @@ -33,7 +33,7 @@ class EnvironmentTest extends TestCase
public function testPhpVersion()
{
$this->assertTrue(
version_compare('7.1.3', phpversion(), '<='),
version_compare('7.1.3', PHP_VERSION, '<='),
'phpMyAdmin requires PHP 7.1.3 or above'
);
}
Expand Down

0 comments on commit ae77d63

Please sign in to comment.