File tree 2 files changed +1
-35
lines changed
2 files changed +1
-35
lines changed Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ function __autoload( $p_class ) {
280
280
require_api ( 'php_api.php ' );
281
281
282
282
# Enforce our minimum PHP requirements
283
- if ( !php_version_at_least ( PHP_MIN_VERSION ) ) {
283
+ if ( !( version_compare ( PHP_VERSION , PHP_MIN_VERSION ) >= 0 ) ) {
284
284
@ob_end_clean ();
285
285
echo '<strong>FATAL ERROR: Your version of PHP is too old. MantisBT requires PHP version ' . PHP_MIN_VERSION . ' or newer</strong><br />Your version of PHP is version ' . phpversion ();
286
286
die ();
Original file line number Diff line number Diff line change @@ -52,37 +52,3 @@ function php_mode() {
52
52
53
53
return $ s_mode ;
54
54
}
55
-
56
- /**
57
- * Returns true if the current PHP version is higher than the one specified in the given string
58
- * @param string $p_version_string php version string to check
59
- * @return bool
60
- */
61
- function php_version_at_least ( $ p_version_string ) {
62
- static $ s_cached_version ;
63
-
64
- if ( isset ( $ s_cached_version [$ p_version_string ] ) ) {
65
- return $ s_cached_version [$ p_version_string ];
66
- }
67
-
68
- $ t_curver = array_pad ( explode ( '. ' , phpversion () ), 3 , 0 );
69
- $ t_minver = array_pad ( explode ( '. ' , $ p_version_string ), 3 , 0 );
70
-
71
- for ( $ i = 0 ;$ i < 3 ;$ i = $ i + 1 ) {
72
- $ t_cur = (int ) $ t_curver [$ i ];
73
- $ t_min = (int ) $ t_minver [$ i ];
74
-
75
- if ( $ t_cur < $ t_min ) {
76
- $ s_cached_version [$ p_version_string ] = false ;
77
- return false ;
78
- }
79
- else if ( $ t_cur > $ t_min ) {
80
- $ s_cached_version [$ p_version_string ] = true ;
81
- return true ;
82
- }
83
- }
84
-
85
- # if we get here, the versions must match exactly so:
86
- $ s_cached_version [$ p_version_string ] = true ;
87
- return true ;
88
- }
You can’t perform that action at this time.
0 commit comments