diff --git a/dev/Common/Booter.js b/dev/Common/Booter.js index f3ca0a320..76abd5929 100644 --- a/dev/Common/Booter.js +++ b/dev/Common/Booter.js @@ -66,7 +66,17 @@ function getComputedStyle(id, name) { * @returns {void} */ function includeStyle(styles) { - window.document.write(unescape('%3Csty' + 'le%3E' + styles + '"%3E%3C/' + 'sty' + 'le%3E')); // eslint-disable-line no-useless-concat + const style = window.document.createElement('style'); + style.type = 'text/css'; + style.text = styles; + + if (style.styleSheet) { + style.styleSheet.cssText = styles; + } else { + style.appendChild(window.document.createTextNode(styles)); + } + + window.document.getElementsByTagName('head')[0].appendChild(style); } /** @@ -74,19 +84,11 @@ function includeStyle(styles) { * @returns {void} */ function includeScr(src) { - window.document.write( - unescape( - '%3Csc' + - 'ript type="text/jav' + - 'ascr' + - 'ipt" data-cfasync="false" sr' + - 'c="' + - src + - '"%3E%3C/' + - 'scr' + - 'ipt%3E' - ) - ); // eslint-disable-line no-useless-concat + const script = window.document.createElement('script'); + script.type = 'text/javascript'; + script.src = src; + + window.document.getElementsByTagName('head')[0].appendChild(script); } /** @@ -217,7 +219,6 @@ function runApp() { jassl && progressJs && appData && - appData.TemplatesLink && appData.LangLink && appData.StaticLibJsLink && appData.StaticAppJsLink && @@ -250,7 +251,7 @@ function runApp() { libs() .then(() => { p.set(20); - return window.Promise.all([jassl(appData.TemplatesLink), jassl(appData.LangLink)]); + return jassl(appData.LangLink); }) .then(() => { p.set(30); diff --git a/dev/bootstrap.js b/dev/bootstrap.js index 5106eeb5d..af0f1506c 100644 --- a/dev/bootstrap.js +++ b/dev/bootstrap.js @@ -33,17 +33,22 @@ export default (App) => { window.rl = rl; + const start = () => { + window.setTimeout(() => { + $html.removeClass('no-js rl-booted-trigger').addClass('rl-booted'); + + App.bootstart(); + }, Enums.Magics.Time10ms); + }; + window.__APP_BOOT = (fErrorCallback) => { domReady(() => { window.setTimeout(() => { - if (window.rainloopTEMPLATES && window.rainloopTEMPLATES[0]) { + if (window.document.getElementById('rainloop-templates-id')) { + start(); + } else if (window.rainloopTEMPLATES && window.rainloopTEMPLATES[0]) { window.document.getElementById('rl-templates').innerHTML = window.rainloopTEMPLATES[0]; - - window.setTimeout(() => { - $html.removeClass('no-js rl-booted-trigger').addClass('rl-booted'); - - App.bootstart(); - }, Enums.Magics.Time10ms); + start(); } else { fErrorCallback(); } diff --git a/package.json b/package.json index 2c04aa351..fa60ca56b 100644 --- a/package.json +++ b/package.json @@ -47,14 +47,14 @@ ], "readmeFilename": "README.md", "devDependencies": { - "@babel/core": "7.8.4", + "@babel/core": "7.8.7", "@babel/plugin-proposal-class-properties": "7.8.3", "@babel/plugin-proposal-decorators": "7.8.3", "@babel/plugin-transform-runtime": "7.8.3", - "@babel/preset-env": "7.8.4", - "@babel/runtime-corejs3": "7.8.4", - "autolinker": "3.11.1", - "babel-eslint": "10.0.3", + "@babel/preset-env": "7.8.7", + "@babel/runtime-corejs3": "7.8.7", + "autolinker": "3.13.0", + "babel-eslint": "10.1.0", "babel-loader": "8.0.6", "classnames": "2.2.6", "copy-webpack-plugin": "5.1.1", @@ -69,7 +69,7 @@ "gulp-autoprefixer": "7.0.1", "gulp-cached": "1.1.1", "gulp-chmod": "3.0.0", - "gulp-clean-css": "4.2.0", + "gulp-clean-css": "4.3.0", "gulp-concat-util": "0.5.5", "gulp-eol": "0.2.0", "gulp-eslint": "6.0.0", @@ -112,14 +112,14 @@ "prettier": "1.19.1", "raf": "3.4.1", "raw-loader": "4.0.0", - "rimraf": "3.0.1", + "rimraf": "3.0.2", "simplestatemanager": "4.1.1", "style-loader": "1.1.3", "underscore": "1.9.2", - "webpack": "4.41.5", - "webpack-cli": "3.3.10" }, "dependencies": { "gulp-terser": "^1.2.0" + "webpack": "4.42.0", + "webpack-cli": "3.3.11" } } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php index 2a8b8ef6d..35ee65059 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php @@ -700,7 +700,7 @@ END; { $iPos = \strpos($aTempArr[1], '?', 2); $aTempArr[0] = \substr($aTempArr[1], 2, $iPos - 2); - $sEncType = \strtoupper($aTempArr[1]{$iPos + 1}); + $sEncType = \strtoupper($aTempArr[1][$iPos + 1]); switch ($sEncType) { case 'Q': @@ -1986,13 +1986,13 @@ END; for ($iIndex = 0; $iLen > 0; $iIndex++, $iLen--) { - $sChar = $sStr{$iIndex}; + $sChar = $sStr[$iIndex]; if ($sChar == '&') { $iIndex++; $iLen--; - $sChar = isset($sStr{$iIndex}) ? $sStr{$iIndex} : null; + $sChar = isset($sStr[$iIndex]) ? $sStr[$iIndex] : null; if ($sChar === null) { break; @@ -2008,7 +2008,7 @@ END; $iK = 10; for (; $iLen > 0; $iIndex++, $iLen--) { - $sChar = $sStr{$iIndex}; + $sChar = $sStr[$iIndex]; $iB = $aArray[\ord($sChar)]; if ((\ord($sChar) & 0x80) || $iB == -1) @@ -2052,7 +2052,7 @@ END; if (($iCh || $iK < 6) || (!$iLen || $sChar != '-') || - ($iLen > 2 && '&' === $sStr{$iIndex+1} && '-' !== $sStr{$iIndex+2})) + ($iLen > 2 && '&' === $sStr[$iIndex+1] && '-' !== $sStr[$iIndex+2])) { return $bError; } @@ -2090,7 +2090,7 @@ END; while ($sLen) { - $iC = \ord($sStr{$iIndex}); + $iC = \ord($sStr[$iIndex]); if ($iC < 0x80) { $iCh = $iC; @@ -2140,7 +2140,7 @@ END; for ($iJ = 0; $iJ < $iN; $iJ++) { - $iO = \ord($sStr{$iIndex+$iJ}); + $iO = \ord($sStr[$iIndex+$iJ]); if (($iO & 0xc0) != 0x80) { return $bError; diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php index 2803d2198..2a8f7e85f 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php @@ -1865,7 +1865,7 @@ class MailClient if (!\is_array($aResultUids)) { $aResultUids = $bUseSortIfSupported ? - $this->oImapClient->MessageSimpleSort(array('REVERSE ARRIVAL'), $sSearchCriterias, true) : + $this->oImapClient->MessageSimpleSort(array('REVERSE DATE'), $sSearchCriterias, true) : $this->oImapClient->MessageSimpleSearch($sSearchCriterias, true, \MailSo\Base\Utils::IsAscii($sSearchCriterias) ? '' : 'UTF-8') ; diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Email.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Email.php index 9dd393f5d..f8f4b0dbf 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Email.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Email.php @@ -102,11 +102,11 @@ class Email while ($iCurrentIndex < \strlen($sEmailAddress)) { - switch ($sEmailAddress{$iCurrentIndex}) + switch ($sEmailAddress[$iCurrentIndex]) { // case '\'': case '"': -// $sQuoteChar = $sEmailAddress{$iCurrentIndex}; +// $sQuoteChar = $sEmailAddress[$iCurrentIndex]; if ((!$bInName) && (!$bInAddress) && (!$bInComment)) { $bInName = true; diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/EmailCollection.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/EmailCollection.php index 53e5db391..3ab943af4 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/EmailCollection.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/EmailCollection.php @@ -156,16 +156,16 @@ class EmailCollection extends \MailSo\Base\Collection while ($iCurrentPos < $sWorkingRecipientsLen) { - switch ($sWorkingRecipients{$iCurrentPos}) + switch ($sWorkingRecipients[$iCurrentPos]) { case '\'': case '"': if (!$bIsInQuotes) { - $sChQuote = $sWorkingRecipients{$iCurrentPos}; + $sChQuote = $sWorkingRecipients[$iCurrentPos]; $bIsInQuotes = true; } - else if ($sChQuote == $sWorkingRecipients{$iCurrentPos}) + else if ($sChQuote == $sWorkingRecipients[$iCurrentPos]) { $bIsInQuotes = false; } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/EmailDep.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/EmailDep.php index 64173bed3..6dea1c527 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/EmailDep.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/EmailDep.php @@ -111,11 +111,11 @@ class EmailDep while ($iCurrentIndex < \strlen($sEmailAddress)) { - switch ($sEmailAddress{$iCurrentIndex}) + switch ($sEmailAddress[$iCurrentIndex]) { // case '\'': case '"': -// $sQuoteChar = $sEmailAddress{$iCurrentIndex}; +// $sQuoteChar = $sEmailAddress[$iCurrentIndex]; if ((!$bInName) && (!$bInAddress) && (!$bInComment)) { $bInName = true; diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Sieve/ManageSieveClient.php b/rainloop/v/0.0.0/app/libraries/MailSo/Sieve/ManageSieveClient.php index cd4e17982..f715a312b 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Sieve/ManageSieveClient.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Sieve/ManageSieveClient.php @@ -325,7 +325,7 @@ class ManageSieveClient extends \MailSo\Net\NetClient $sScript = ''; if (\is_array($mResponse) && 0 < \count($mResponse)) { - if ('{' === $mResponse[0]{0}) + if ('{' === $mResponse[0][0]) { \array_shift($mResponse); } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Vendors/Net/IDNA2.php b/rainloop/v/0.0.0/app/libraries/MailSo/Vendors/Net/IDNA2.php index 820683411..c3dc298f2 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Vendors/Net/IDNA2.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Vendors/Net/IDNA2.php @@ -2687,7 +2687,7 @@ class Net_IDNA2 if ($delim_pos > self::_byteLength($this->_punycode_prefix)) { for ($k = self::_byteLength($this->_punycode_prefix); $k < $delim_pos; ++$k) { - $decoded[] = ord($encoded{$k}); + $decoded[] = ord($encoded[$k]); } } else { $decoded = array(); @@ -2704,7 +2704,7 @@ class Net_IDNA2 for ($enco_idx = ($delim_pos)? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) { for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) { - $digit = $this->_decodeDigit($encoded{$enco_idx++}); + $digit = $this->_decodeDigit($encoded[$enco_idx++]); $idx += $digit * $w; $t = ($k <= $bias) ? @@ -3116,7 +3116,7 @@ class Net_IDNA2 $mode = 'next'; $test = 'none'; for ($k = 0; $k < $inp_len; ++$k) { - $v = ord($input{$k}); // Extract byte from input string + $v = ord($input[$k]); // Extract byte from input string if ($v < 128) { // We found an ASCII char - put into stirng as is $output[$out_len] = $v; @@ -3283,7 +3283,7 @@ class Net_IDNA2 $out_len++; $output[$out_len] = 0; } - $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); + $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) ); } return $output; } diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index 4af4cdb87..bbf181b90 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -1525,7 +1525,7 @@ class Actions /* required by Index.html and rl.js: -NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBackground PluginsLink AuthAccountHash +NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground PluginsLink AuthAccountHash */ $aResult = array( @@ -1973,7 +1973,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack $aResult['LangLink'] = './?/Lang/0/'.($bAdmin ? 'Admin' : 'App').'/'. ($bAdmin ? $aResult['LanguageAdmin'] : $aResult['Language']).'/'.$sStaticCache.'/'; - $aResult['TemplatesLink'] = './?/Templates/0/'.($bAdmin ? 'Admin' : 'App').'/'.$sStaticCache.'/'; + // $aResult['TemplatesLink'] = './?/Templates/0/'.($bAdmin ? 'Admin' : 'App').'/'.$sStaticCache.'/'; $bAppJsDebug = !!$this->Config()->Get('labs', 'use_app_debug_js', false); @@ -9260,7 +9260,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack { while (($sFile = \readdir($rDirH)) !== false) { - if ('.' !== $sFile{0} && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less')) + if ('.' !== $sFile[0] && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less')) { if ('Default' === $sFile) { @@ -9288,7 +9288,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack { while (($sFile = \readdir($rDirH)) !== false) { - if ('.' !== $sFile{0} && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less')) + if ('.' !== $sFile[0] && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less')) { $sList[] = $sFile.'@custom'; } @@ -9341,7 +9341,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack { while (($sFile = \readdir($rDirH)) !== false) { - if ('.' !== $sFile{0} && \is_file($sDir.'/'.$sFile) && '.yml' === \substr($sFile, -4)) + if ('.' !== $sFile[0] && \is_file($sDir.'/'.$sFile) && '.yml' === \substr($sFile, -4)) { $sLang = \substr($sFile, 0, -4); if (0 < \strlen($sLang) && 'always' !== $sLang && '_source.en' !== $sLang) diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php index d190475e6..a156264df 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php @@ -99,6 +99,10 @@ class Application extends \RainLoop\Config\AbstractConfig */ public function SetPassword($sPassword) { + if (function_exists('password_hash')) + { + return $this->Set('security', 'admin_password', password_hash($sPassword, PASSWORD_DEFAULT)); + } return $this->Set('security', 'admin_password', \md5(APP_SALT.$sPassword.APP_SALT)); } @@ -112,8 +116,22 @@ class Application extends \RainLoop\Config\AbstractConfig $sPassword = (string) $sPassword; $sConfigPassword = (string) $this->Get('security', 'admin_password', ''); - return 0 < \strlen($sPassword) && - (($sPassword === $sConfigPassword && '12345' === $sConfigPassword) || \md5(APP_SALT.$sPassword.APP_SALT) === $sConfigPassword); + if (0 < strlen($sConfigPassword)) + { + if (($sPassword === $sConfigPassword) && ('12345' === $sConfigPassword)) // password has not been set + { + return true; + } + if (32 == strlen($sConfigPassword)) // legacy md5 hash + { + return (\md5(APP_SALT.$sPassword.APP_SALT) === $sConfigPassword); + } + if (function_exists('password_verify')) // secure hash + { + return password_verify($sPassword, $sConfigPassword); + } + } + return false; } /** diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php index 9d80121a1..8fffce1b6 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php @@ -213,7 +213,7 @@ class Service if (0 === \strlen($sResult)) { -// $aTemplateParameters['{{BaseTemplates}}'] = $this->oServiceActions->compileTemplates($bAdmin, false); + $aTemplateParameters['{{BaseTemplates}}'] = $this->oServiceActions->compileTemplates($bAdmin, false); $sResult = \strtr(\file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/Index.html'), $aTemplateParameters); $sResult = \RainLoop\Utils::ClearHtmlOutput($sResult); diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php index 873934e81..4d8311bcd 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php @@ -1302,7 +1302,7 @@ class ServiceActions $this->oActions->Plugins()->CompileTemplate($aTemplates, $bAdmin); - $sHtml = ''; + $sHtml = ''; foreach ($aTemplates as $sName => $sFile) { $sName = \preg_replace('/[^a-zA-Z0-9]/', '', $sName); diff --git a/rainloop/v/0.0.0/app/libraries/lessphp/lessc.inc.php b/rainloop/v/0.0.0/app/libraries/lessphp/lessc.inc.php index 3a185030d..22706e724 100644 --- a/rainloop/v/0.0.0/app/libraries/lessphp/lessc.inc.php +++ b/rainloop/v/0.0.0/app/libraries/lessphp/lessc.inc.php @@ -659,7 +659,7 @@ class lessc { if ($suffix !== null && $subProp[0] == "assign" && is_string($subProp[1]) && - $subProp[1]{0} != $this->vPrefix) + $subProp[1][0] != $this->vPrefix) { $subProp[2] = array( 'list', ' ', @@ -1626,7 +1626,7 @@ class lessc { $this->pushEnv(); $parser = new lessc_parser($this, __METHOD__); foreach ($args as $name => $strValue) { - if ($name{0} != '@') $name = '@'.$name; + if ($name[0] != '@') $name = '@'.$name; $parser->count = 0; $parser->buffer = (string)$strValue; if (!$parser->propertyValue($value)) { @@ -2284,7 +2284,7 @@ class lessc_parser { $hidden = true; if (!isset($block->args)) { foreach ($block->tags as $tag) { - if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) { + if (!is_string($tag) || $tag[0] != $this->lessc->mPrefix) { $hidden = false; break; } @@ -2338,7 +2338,7 @@ class lessc_parser { protected function fixTags($tags) { // move @ tags out of variable namespace foreach ($tags as &$tag) { - if ($tag{0} == $this->lessc->vPrefix) + if ($tag[0] == $this->lessc->vPrefix) $tag[0] = $this->lessc->mPrefix; } return $tags; @@ -3068,7 +3068,7 @@ class lessc_parser { protected function end() { if ($this->literal(';')) { return true; - } elseif ($this->count == strlen($this->buffer) || $this->buffer{$this->count} == '}') { + } elseif ($this->count == strlen($this->buffer) || $this->buffer[$this->count] == '}') { // if there is end of file or a closing block next then we don't need a ; return true; } diff --git a/rainloop/v/0.0.0/app/localization/webmail/fi_FI.yml b/rainloop/v/0.0.0/app/localization/webmail/fi_FI.yml index 02abf7106..a8716590a 100644 --- a/rainloop/v/0.0.0/app/localization/webmail/fi_FI.yml +++ b/rainloop/v/0.0.0/app/localization/webmail/fi_FI.yml @@ -85,7 +85,7 @@ fi_FI: MENU_SELECT_SEEN: "Luetut" MENU_SELECT_FLAGGED: "Merkityt" MENU_SELECT_UNFLAGGED: "Merkkaamattomat" - EMPTY_LIST: "Tyhjennä lista" + EMPTY_LIST: "Tyhjä lista" EMPTY_SEARCH_LIST: "Yhtään viestiä ei löytynyt ehdoillasi." SEARCH_RESULT_FOR: "Hakutulokset haulle \"%SEARCH%\"" BACK_TO_MESSAGE_LIST: "Takaisin viestilistaan" @@ -429,7 +429,7 @@ fi_FI: LABEL_TEMPLATES_NAME: "Mallipohjat" LABEL_SECURITY_NAME: "Turvallisuus" LABEL_SOCIAL_NAME: "Sosiaalinen" - LABEL_THEMES_NAME: "emat" + LABEL_THEMES_NAME: "Teemat" LABEL_CHANGE_PASSWORD_NAME: "Salasana" LABEL_OPEN_PGP_NAME: "OpenPGP" BUTTON_BACK: "Takaisin" diff --git a/rainloop/v/0.0.0/app/templates/Index.html b/rainloop/v/0.0.0/app/templates/Index.html index 1a3d7d2b5..dbfe75077 100644 --- a/rainloop/v/0.0.0/app/templates/Index.html +++ b/rainloop/v/0.0.0/app/templates/Index.html @@ -1,33 +1,37 @@ -
- - - - - - - - - - - {{BaseContentSecurityPolicy}} -