Bugfix: Trying to access array offset on value of type null in /app/libraries/MailSo/Sieve/ManageSieveClient.php on line 223

Bugfix: Return value of RainLoop\UserAgent::getHeader() must be of the type string, null returned in /app/libraries/RainLoop/UserAgent.php on line 156
Bugfix: file_exists() also checks for directory, should use is_file
Bugfix: accidentally removed <div id="rl-check"></div>
This commit is contained in:
djmaze 2020-07-31 16:13:38 +02:00
parent 97bf6f70b8
commit 45fa12be42
6 changed files with 48 additions and 36 deletions

View file

@ -36,50 +36,59 @@ This fork has the following changes:
* Admin uses password_hash/password_verify * Admin uses password_hash/password_verify
* Auth failed attempts written to syslog * Auth failed attempts written to syslog
* Added Fail2ban instructions * Added Fail2ban instructions
* ES2015 (removed polyfills and Modernizr) * ES2015
* PHP 7.3+ required * PHP 7.3+ required
* PHP mbstring extension required * PHP mbstring extension required
* PHP replaced pclZip with ZipArchive * PHP replaced pclZip with ZipArchive
* PHP yaml extension else use the old Spyc * PHP yaml extension else use the old Spyc
* Removed BackwardCapability (class \RainLoop\Account) * Removed BackwardCapability (class \RainLoop\Account)
* Removed ChangePassword (plugins won't work) * Removed ChangePassword (plugins won't work)
* Removed JS nanoscroll, jquery-scrollstop, jquery-mousewheel, matchmedia-polyfill
* Removed OAuth support * Removed OAuth support
* Removed POP3 support * Removed POP3 support
* Removed background video support * Removed background video support
* Removed Sentry (Application Monitoring and Error Tracking Software) * Removed Sentry (Application Monitoring and Error Tracking Software)
* Replaced gulp-uglify with gulp-terser * Replaced gulp-uglify with gulp-terser
* CRLF => LF line endings * CRLF => LF line endings
* Converted underscore.js to native code
* Ongoing removal of old JavaScript code (things are native these days) * Ongoing removal of old JavaScript code (things are native these days)
### Removal of old JavaScript ### Removal of old JavaScript
This fork uses jQuery.slim, downsized/simplified versions of scripts and has no support for Internet Explorer. This fork uses downsized/simplified versions of scripts and has no support for Internet Explorer.
The result is faster and smaller download code (good for mobile networks). The result is faster and smaller download code (good for mobile networks).
Things might work in Edge 15-18, Firefox 47-62 and Chrome 54-68 due to one polyfill for array.flat(). Things might work in Edge 15-18, Firefox 47-62 and Chrome 54-68 due to one polyfill for array.flat().
|js/* |1.14.0 |native | * Replaced jQuery with jQuery.slim
|----------- |--------: |--------: | * Removed pikaday
|admin.js |2.130.942 |1.222.392 | * Removed underscore
|app.js |4.184.455 |2.984.765 | * Removed polyfills
|boot.js | 671.522 | 94.230 | * Removed Modernizr
|libs.js | 647.614 | 507.015 | * Removed nanoscroll
|polyfills.js | 325.834 | 0 | * Removed jquery-scrollstop
|TOTAL js |7.960.367 |4.808.402 | * Removed jquery-mousewheel
* Removed matchmedia-polyfill
|js/min/* |1.14.0 |native | |js/* |1.14.0 |native |gzip 1.14 |gzip |
|--------------- |--------: |--------: | |----------- |--------: |--------: |--------: |--------: |
|admin.min.js | 252.147 | 157.533 | |admin.js |2.130.942 |1.221.247 | 485.481 | 299.073 |
|app.min.js | 511.202 | 389.339 | |app.js |4.184.455 |2.984.765 | 932.725 | 697.869 |
|boot.min.js | 66.007 | 11.575 | |boot.js | 671.522 | 94.230 | 169.502 | 28.386 |
|libs.min.js | 572.545 | 464.161 | |libs.js | 647.614 | 507.015 | 194.728 | 153.918 |
|polyfills.min.js | 32.452 | 0 | |polyfills.js | 325.834 | 0 | 71.825 | 0 |
|TOTAL js/min |1.434.353 |1.022.608 | |TOTAL js |7.960.367 |4.807.257 |1.854.261 |1.179.246 |
|js/min/* |1.14.0 |native |gzip 1.14 |gzip |
|--------------- |--------: |--------: |--------: |--------: |
|admin.min.js | 252.147 | 157.523 | 73.657 | 45.136 |
|app.min.js | 511.202 | 389.339 |140.462 |102.945 |
|boot.min.js | 66.007 | 11.575 | 22.567 | 4.461 |
|libs.min.js | 572.545 | 464.161 |176.720 |143.916 |
|polyfills.min.js | 32.452 | 0 | 11.312 | 0 |
|TOTAL js/min |1.434.353 |1.022.598 |424.718 |296.458 |
411.755 bytes (128.260 gzip) is not much, but it feels faster.
411.745 bytes is not much, but it feels faster.
|css/* |1.14.0 |native | |css/* |1.14.0 |native |
|-------------- |--------: |--------: | |-------------- |--------: |--------: |

View file

@ -215,7 +215,7 @@ class ManageSieveClient extends \MailSo\Net\NetClient
foreach ($aResponse as $sLine) foreach ($aResponse as $sLine)
{ {
$aTokens = $this->parseLine($sLine); $aTokens = $this->parseLine($sLine);
if (false === $aTokens) if (!$aTokens)
{ {
continue; continue;
} }

View file

@ -635,7 +635,7 @@ class ServiceActions
$sThemeValuesFile = APP_VERSION_ROOT_PATH.'app/templates/Themes/values.less'; $sThemeValuesFile = APP_VERSION_ROOT_PATH.'app/templates/Themes/values.less';
$sThemeTemplateFile = APP_VERSION_ROOT_PATH.'app/templates/Themes/template.less'; $sThemeTemplateFile = APP_VERSION_ROOT_PATH.'app/templates/Themes/template.less';
if (\file_exists($sThemeFile) && \file_exists($sThemeTemplateFile) && \file_exists($sThemeValuesFile)) if (\is_file($sThemeFile) && \is_file($sThemeTemplateFile) && \is_file($sThemeValuesFile))
{ {
$aResult[] = '@base: "'. $aResult[] = '@base: "'.
($bCustomTheme ? Utils::WebPath() : Utils::WebVersionPath()). ($bCustomTheme ? Utils::WebPath() : Utils::WebVersionPath()).
@ -645,7 +645,7 @@ class ServiceActions
$aResult[] = \file_get_contents($sThemeFile); $aResult[] = \file_get_contents($sThemeFile);
$aResult[] = \file_get_contents($sThemeTemplateFile); $aResult[] = \file_get_contents($sThemeTemplateFile);
if (\file_exists($sThemeExtFile)) if (\is_file($sThemeExtFile))
{ {
$aResult[] = \file_get_contents($sThemeExtFile); $aResult[] = \file_get_contents($sThemeExtFile);
} }
@ -1037,7 +1037,7 @@ class ServiceActions
$sMomentFileName = APP_VERSION_ROOT_PATH.'app/localization/moment/'. $sMomentFileName = APP_VERSION_ROOT_PATH.'app/localization/moment/'.
$this->convertLanguageNameToMomentLanguageName($sLanguage).'.js'; $this->convertLanguageNameToMomentLanguageName($sLanguage).'.js';
if (\file_exists($sMomentFileName)) if (\is_file($sMomentFileName))
{ {
$sMoment = \file_get_contents($sMomentFileName); $sMoment = \file_get_contents($sMomentFileName);
$sMoment = \preg_replace('/\/\/[^\n]+\n/', '', $sMoment); $sMoment = \preg_replace('/\/\/[^\n]+\n/', '', $sMoment);

View file

@ -150,8 +150,10 @@ class UserAgent
public static function getHeader() : string public static function getHeader() : string
{ {
static $agent; static $agent;
if (null === $agent && isset($_SERVER['HTTP_USER_AGENT'])) { if (null === $agent) {
$agent = strtolower(substr($_SERVER['HTTP_USER_AGENT'], 0, 500)); $agent = isset($_SERVER['HTTP_USER_AGENT'])
? strtolower(substr($_SERVER['HTTP_USER_AGENT'], 0, 500))
: '';
} }
return $agent; return $agent;
} }

View file

@ -22,6 +22,7 @@
<body class="thm-body"> <body class="thm-body">
<div id="rl-app"></div> <div id="rl-app"></div>
<div id="rl-check"></div>
<script type="text/javascript" data-cfasync="false" src="{{BaseAppBootScriptLink}}"></script> <script type="text/javascript" data-cfasync="false" src="{{BaseAppBootScriptLink}}"></script>
</body> </body>

View file

@ -28,7 +28,7 @@
define('APP_DEFAULT_PRIVATE_DATA_NAME', '_default_'); define('APP_DEFAULT_PRIVATE_DATA_NAME', '_default_');
$sPrivateDataFolderInternalName = file_exists(APP_INDEX_ROOT_PATH.'MULTIPLY') ? APP_SITE : ''; $sPrivateDataFolderInternalName = is_file(APP_INDEX_ROOT_PATH.'MULTIPLY') ? APP_SITE : '';
define('APP_PRIVATE_DATA_NAME', 0 === strlen($sPrivateDataFolderInternalName) ? APP_DEFAULT_PRIVATE_DATA_NAME : $sPrivateDataFolderInternalName); define('APP_PRIVATE_DATA_NAME', 0 === strlen($sPrivateDataFolderInternalName) ? APP_DEFAULT_PRIVATE_DATA_NAME : $sPrivateDataFolderInternalName);
define('APP_MULTIPLY', 0 < strlen($sPrivateDataFolderInternalName) && APP_DEFAULT_PRIVATE_DATA_NAME !== APP_PRIVATE_DATA_NAME); define('APP_MULTIPLY', 0 < strlen($sPrivateDataFolderInternalName) && APP_DEFAULT_PRIVATE_DATA_NAME !== APP_PRIVATE_DATA_NAME);
@ -40,7 +40,7 @@
$sCustomDataPath = ''; $sCustomDataPath = '';
$sCustomConfiguration = ''; $sCustomConfiguration = '';
if (file_exists(APP_INDEX_ROOT_PATH.'include.php')) if (is_file(APP_INDEX_ROOT_PATH.'include.php'))
{ {
include_once APP_INDEX_ROOT_PATH.'include.php'; include_once APP_INDEX_ROOT_PATH.'include.php';
} }
@ -55,9 +55,9 @@
define('APP_DATA_FOLDER_PATH_UNIX', str_replace('\\', '/', APP_DATA_FOLDER_PATH)); define('APP_DATA_FOLDER_PATH_UNIX', str_replace('\\', '/', APP_DATA_FOLDER_PATH));
$sSalt = file_get_contents(APP_DATA_FOLDER_PATH.'SALT.php'); $sSalt = is_file(APP_DATA_FOLDER_PATH.'SALT.php') ? file_get_contents(APP_DATA_FOLDER_PATH.'SALT.php') : '';
$sData = file_exists(APP_DATA_FOLDER_PATH.'DATA.php') ? file_get_contents(APP_DATA_FOLDER_PATH.'DATA.php') : ''; $sData = is_file(APP_DATA_FOLDER_PATH.'DATA.php') ? file_get_contents(APP_DATA_FOLDER_PATH.'DATA.php') : '';
$sInstalled = file_get_contents(APP_DATA_FOLDER_PATH.'INSTALLED'); $sInstalled = is_file(APP_DATA_FOLDER_PATH.'INSTALLED') ? file_get_contents(APP_DATA_FOLDER_PATH.'INSTALLED') : '';
// installation checking data folder // installation checking data folder
if (APP_VERSION !== $sInstalled) if (APP_VERSION !== $sInstalled)
@ -68,8 +68,8 @@
$sCheckFolder = APP_DATA_FOLDER_PATH.$sCheckName; $sCheckFolder = APP_DATA_FOLDER_PATH.$sCheckName;
$sCheckFilePath = APP_DATA_FOLDER_PATH.$sCheckName.'/'.$sCheckName.'.file'; $sCheckFilePath = APP_DATA_FOLDER_PATH.$sCheckName.'/'.$sCheckName.'.file';
unlink($sCheckFilePath); is_file($sCheckFilePath) && unlink($sCheckFilePath);
rmdir($sCheckFolder); is_dir($sCheckFolder) && rmdir($sCheckFolder);
if (!is_dir(APP_DATA_FOLDER_PATH)) if (!is_dir(APP_DATA_FOLDER_PATH))
{ {
@ -136,9 +136,9 @@
file_put_contents(APP_DATA_FOLDER_PATH.'index.html', 'Forbidden'); file_put_contents(APP_DATA_FOLDER_PATH.'index.html', 'Forbidden');
file_put_contents(APP_DATA_FOLDER_PATH.'index.php', 'Forbidden'); file_put_contents(APP_DATA_FOLDER_PATH.'index.php', 'Forbidden');
if (!file_exists(APP_DATA_FOLDER_PATH.'.htaccess') && file_exists(APP_VERSION_ROOT_PATH.'app/.htaccess')) if (!is_file(APP_DATA_FOLDER_PATH.'.htaccess') && is_file(APP_VERSION_ROOT_PATH.'app/.htaccess'))
{ {
file_put_contents(APP_DATA_FOLDER_PATH.'.htaccess', file_get_contents(APP_VERSION_ROOT_PATH.'app/.htaccess')); copy(APP_VERSION_ROOT_PATH.'app/.htaccess', APP_DATA_FOLDER_PATH.'.htaccess');
} }
if (!is_dir(APP_PRIVATE_DATA)) if (!is_dir(APP_PRIVATE_DATA))