Browse Source

Merge pull request #814 from hestiacp/bugfix-roundcube-php7.4

Roundcube fixes for PHP 7.4 compatibility
Raphael Schneeberger 5 years ago
parent
commit
910a5af8f3

+ 3 - 2
CHANGELOG.md

@@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file.
 
 
 ## [CURRENT] - Development
 ## [CURRENT] - Development
 ### Features
 ### Features
-- Added support for configuring individual TTL per DNS record. Thanks to @jaapmarcus
+- Added support for configuring individual TTL per DNS record. Thanks to @jaapmarcus!
 - Added support for Ubuntu Server 20.04 LTS.
 - Added support for Ubuntu Server 20.04 LTS.
 - Added the ability to set the php cli version per user (using alias).
 - Added the ability to set the php cli version per user (using alias).
 
 
@@ -26,8 +26,9 @@ All notable changes to this project will be documented in this file.
 - Rework busy port validation in v-change-sys-port.
 - Rework busy port validation in v-change-sys-port.
 - Fixed ssh config save bug when edit the over interface.
 - Fixed ssh config save bug when edit the over interface.
 - Fixed different permission issues on user restore.
 - Fixed different permission issues on user restore.
-- Stop trying to renew LE certs after multiple consecutive failed attempts. Thanks @dpeca
+- Stop trying to renew LE certs after multiple consecutive failed attempts. Thanks to @dpeca!
 - Implement a validation function to verify the correct version in hestia.conf prior to install a new one.
 - Implement a validation function to verify the correct version in hestia.conf prior to install a new one.
+- Roundcube fixes for PHP 7.4 compatibility.
 
 
 ## [1.1.1] - 2020-03-24 - Hotfix
 ## [1.1.1] - 2020-03-24 - Hotfix
 ### Features
 ### Features

+ 9 - 0
install/hst-install-debian.sh

@@ -1579,6 +1579,15 @@ if [ "$dovecot" = 'yes' ] && [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
             fi
             fi
         fi
         fi
     fi
     fi
+    
+    # Fixes for PHP 7.4 compatibility
+    sed -i 's/\"\\n\", $identities/$identities, \"\\n\"/g' /usr/share/roundcube/plugins/enigma/lib/enigma_ui.php
+    sed -i 's/(array_keys($post_search), \x27|\x27)/(\x27|\x27, array_keys($post_search))/g' /usr/share/roundcube/program/lib/Roundcube/rcube_contacts.php
+    sed -i 's/implode($name, \x27.\x27)/implode(\x27.\x27, $name)/g' /usr/share/roundcube/program/lib/Roundcube/rcube_db.php
+    sed -i 's/$fields, \x27,\x27/',', $fields/g' /usr/share/roundcube/program/steps/addressbook/search.inc
+    sed -i 's/implode($fields, \x27,\x27)/implode(\x27,\x27, $fields)/g' /usr/share/roundcube/program/steps/addressbook/search.inc
+    sed -i 's/implode($bstyle, \x27; \x27)/implode(\x27; \x27, $bstyle)/g' /usr/share/roundcube/program/steps/mail/sendmail.inc
+    
     # Configure webmail alias
     # Configure webmail alias
     echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
     echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
 
 

+ 8 - 0
install/hst-install-ubuntu.sh

@@ -1525,6 +1525,14 @@ if [ "$dovecot" = 'yes' ] && [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
     sed -i "s/localhost/$servername/g" /etc/roundcube/plugins/password/config.inc.php
     sed -i "s/localhost/$servername/g" /etc/roundcube/plugins/password/config.inc.php
     mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
     mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
 
 
+    # Fixes for PHP 7.4 compatibility
+    sed -i 's/\"\\n\", $identities/$identities, \"\\n\"/g' /usr/share/roundcube/plugins/enigma/lib/enigma_ui.php
+    sed -i 's/(array_keys($post_search), \x27|\x27)/(\x27|\x27, array_keys($post_search))/g' /usr/share/roundcube/program/lib/Roundcube/rcube_contacts.php
+    sed -i 's/implode($name, \x27.\x27)/implode(\x27.\x27, $name)/g' /usr/share/roundcube/program/lib/Roundcube/rcube_db.php
+    sed -i 's/$fields, \x27,\x27/',', $fields/g' /usr/share/roundcube/program/steps/addressbook/search.inc
+    sed -i 's/implode($fields, \x27,\x27)/implode(\x27,\x27, $fields)/g' /usr/share/roundcube/program/steps/addressbook/search.inc
+    sed -i 's/implode($bstyle, \x27; \x27)/implode(\x27; \x27, $bstyle)/g' /usr/share/roundcube/program/steps/mail/sendmail.inc
+    
     # Configure webmail alias
     # Configure webmail alias
     echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
     echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
 
 

+ 10 - 0
install/upgrade/versions/latest.sh

@@ -28,3 +28,13 @@ if [ "$WEB_SYSTEM" = "apache2" ] && [ ! -e "/etc/apt/sources.list.d/apache2.list
         fi
         fi
     fi
     fi
 fi
 fi
+
+# Roundcube fixes for PHP 7.4 compatibility
+if [ -d /usr/share/roundcube ]; then
+    sed -i 's/\"\\n\", $identities/$identities, \"\\n\"/g' /usr/share/roundcube/plugins/enigma/lib/enigma_ui.php
+    sed -i 's/(array_keys($post_search), \x27|\x27)/(\x27|\x27, array_keys($post_search))/g' /usr/share/roundcube/program/lib/Roundcube/rcube_contacts.php
+    sed -i 's/implode($name, \x27.\x27)/implode(\x27.\x27, $name)/g' /usr/share/roundcube/program/lib/Roundcube/rcube_db.php
+    sed -i 's/$fields, \x27,\x27/',', $fields/g' /usr/share/roundcube/program/steps/addressbook/search.inc
+    sed -i 's/implode($fields, \x27,\x27)/implode(\x27,\x27, $fields)/g' /usr/share/roundcube/program/steps/addressbook/search.inc
+    sed -i 's/implode($bstyle, \x27; \x27)/implode(\x27; \x27, $bstyle)/g' /usr/share/roundcube/program/steps/mail/sendmail.inc
+fi