Browse Source

Use the new check_php_version function everywhere

Thijs Kinkhorst 23 years ago
parent
commit
5d52e3db26

+ 1 - 1
functions/mime.php

@@ -325,7 +325,7 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma
     global $startMessage, $username, $key, $imapServerAddress, $imapPort,
            $show_html_default, $has_unsafe_images, $sort;
 
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
         global $_GET;
     }
     if(isset($_GET['view_unsafe_images'])) {

+ 1 - 1
functions/options.php

@@ -330,7 +330,7 @@ class SquirrelOption {
 }
 
 function save_option($option) {
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
         global $_SESSION;
     }
     global $data_dir;

+ 3 - 3
functions/page_header.php

@@ -19,7 +19,7 @@ require_once(SM_PATH . 'functions/global.php');
 /* Always set up the language before calling these functions */
 function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) {
 
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
             global $_SESSION;
     }
     if (isset($_SESSION['base_uri'])) {
@@ -68,7 +68,7 @@ ECHO;
 
 
 function displayInternalLink($path, $text, $target='') {
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
             global $_SESSION;
     }
 
@@ -85,7 +85,7 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
            $compose_new_win, $username, $datadir, $compose_width, $compose_height,
            $attachemessages, $provider_name, $provider_uri;
 
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
             global $_SESSION;
     }
 

+ 1 - 1
plugins/bug_report/setup.php

@@ -42,7 +42,7 @@ function bug_report_button() {
 function bug_report_save() {
     global $username,$data_dir;
 
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
         global $_POST;
     }
  

+ 4 - 4
plugins/delete_move_next/setup.php

@@ -111,7 +111,7 @@ function delete_move_next_action() {
 
     global $PHP_SELF;
 
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
         global $_GET, $_POST;
     }
 
@@ -277,7 +277,7 @@ function delete_move_next_moveRightMainForm() {
 function delete_move_next_delete() {
     global $imapConnection, $auto_expunge;
 
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
         global $_GET;
     }
 
@@ -294,7 +294,7 @@ function delete_move_next_delete() {
 function delete_move_next_move() {
     global $imapConnection, $mailbox;
 
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
         global $_POST;
     }
 
@@ -349,7 +349,7 @@ function delete_move_next_display_save() {
 
     global $username,$data_dir;
 
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
         global $_POST;
     }
 

+ 2 - 2
plugins/mail_fetch/setup.php

@@ -39,7 +39,7 @@
         global $mailfetch_server_,$mailfetch_alias_,$mailfetch_user_,$mailfetch_pass_;
         global $mailfetch_lmos_, $mailfetch_uidl_, $mailfetch_login_, $mailfetch_fref_;
         global $PHP_SELF;
-        if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+        if ( !check_php_version(4,1) ) {
             global $_SESSION;
         }
         $username = $_SESSION['username'];
@@ -70,7 +70,7 @@
         require_once (SM_PATH . 'plugins/mail_fetch/functions.php');
 
         global $data_dir, $imapServerAddress, $imapPort;
-        if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+        if ( !check_php_version(4,1) ) {
             global $_SESSION, $_COOKIE;
         }
         $username = $_SESSION['username'];

+ 3 - 3
plugins/sent_subfolders/setup.php

@@ -49,7 +49,7 @@ function squirrelmail_plugin_init_sent_subfolders() {
 function sent_subfolders_check_handleAsSent() {
     global $handleAsSent_result, $sent_subfolders_base,
            $use_sent_subfolders;
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
         global $_SESSION;
     }
     $sent_subfolders_base = 'INBOX.Sent';
@@ -88,7 +88,7 @@ function sent_subfolders_load_prefs() {
 function sent_subfolders_optpage_loadhook_folders() {
     global $optpage_data, $imapServerAddress, $imapPort;
 
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
         global $_SESSION, $_COOKIE;
     }
     $username = $_SESSION['username'];
@@ -159,7 +159,7 @@ function sent_subfolders_update_sentfolder() {
     global $data_dir, $imapServerAddress, $imapPort;
     global $use_sent_subfolders, $move_to_sent, $imap_server_type;
 
-    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+    if ( !check_php_version(4,1) ) {
         global $_SESSION, $_COOKIE;
     }
     $username = $_SESSION['username'];

+ 1 - 1
plugins/squirrelspell/sqspell_config.php

@@ -15,7 +15,7 @@ require_once(SM_PATH . 'functions/prefs.php');
 /* Just for poor wretched souls with E_ALL. :) */
 global $data_dir;
 
-if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+if ( !check_php_version(4,1) ) {
     global $_SESSION;
 }
 

+ 1 - 1
plugins/squirrelspell/sqspell_functions.php

@@ -28,7 +28,7 @@
 function sqspell_makePage($title, $scriptsrc, $body){
   global $color, $SQSPELL_VERSION;
 
-  if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+  if ( !check_php_version(4,1) ) {
       global $_GET;
   }
   if (isset($_GET['MOD'])) {