Skip to content
Permalink
Browse files

Bumped dependencies and code for php 7.4 compatibility (#461)

* Bumped pgp PHP 7.4 compatibility

* Bumped PHPMailer to PHP 7.4 compatibility

* Bumped Snoopy net client to PHP 7.4 compatibility

* Bumped memcached client to PHP 7.4 compatibility

* Bumped Services_JSON to PHP 7.4 compatibility

* Bumped to PHP 7.4 compatibility

* Fixed missing currency iso name for NumberFormatter

* Fixed: Non-string needles will be interpreted as strings in the future
  • Loading branch information
Maaiins committed Mar 6, 2020
1 parent 0321a5b commit c63b578a0f68257e0bed727d86d9a1ac7eaaf533
Showing with 8,606 additions and 5,213 deletions.
  1. +41 −41 includes/JSON.php
  2. +46 −0 includes/PHPMailer-6.1.4/COMMITMENT
  3. +19 −21 includes/{PHPMailer_5.2.0 → PHPMailer-6.1.4}/LICENSE
  4. +221 −0 includes/PHPMailer-6.1.4/README.md
  5. +28 −0 includes/PHPMailer-6.1.4/SECURITY.md
  6. +1 −0 includes/PHPMailer-6.1.4/VERSION
  7. +51 −0 includes/PHPMailer-6.1.4/composer.json
  8. +144 −0 includes/PHPMailer-6.1.4/get_oauth_token.php
  9. +25 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-af.php
  10. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-am.php
  11. +27 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-ar.php
  12. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-az.php
  13. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-ba.php
  14. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-be.php
  15. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-bg.php
  16. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-ca.php
  17. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-ch.php
  18. +25 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-cs.php
  19. +6 −6 ...{PHPMailer_5.2.0/language/phpmailer.lang-dk.php → PHPMailer-6.1.4/language/phpmailer.lang-da.php}
  20. +25 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-de.php
  21. +25 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-el.php
  22. +25 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-eo.php
  23. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-es.php
  24. +13 −12 includes/{PHPMailer_5.2.0 → PHPMailer-6.1.4}/language/phpmailer.lang-et.php
  25. +27 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-fa.php
  26. +6 −6 includes/{PHPMailer_5.2.0 → PHPMailer-6.1.4}/language/phpmailer.lang-fi.php
  27. +6 −7 includes/{PHPMailer_5.2.0 → PHPMailer-6.1.4}/language/phpmailer.lang-fo.php
  28. +29 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-fr.php
  29. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-gl.php
  30. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-he.php
  31. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-hi.php
  32. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-hr.php
  33. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-hu.php
  34. +27 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-id.php
  35. +27 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-it.php
  36. +27 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-ja.php
  37. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-ka.php
  38. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-ko.php
  39. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-lt.php
  40. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-lv.php
  41. +25 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-mg.php
  42. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-ms.php
  43. +25 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-nb.php
  44. +28 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-nl.php
  45. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-pl.php
  46. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-pt.php
  47. +29 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-pt_br.php
  48. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-ro.php
  49. +27 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-ru.php
  50. +27 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-sk.php
  51. +27 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-sl.php
  52. +27 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-sr.php
  53. +10 −10 ...{PHPMailer_5.2.0/language/phpmailer.lang-se.php → PHPMailer-6.1.4/language/phpmailer.lang-sv.php}
  54. +27 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-tl.php
  55. +30 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-tr.php
  56. +27 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-uk.php
  57. +26 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-vi.php
  58. +28 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-zh.php
  59. +28 −0 includes/PHPMailer-6.1.4/language/phpmailer.lang-zh_cn.php
  60. +39 −0 includes/PHPMailer-6.1.4/src/Exception.php
  61. +138 −0 includes/PHPMailer-6.1.4/src/OAuth.php
  62. +4,778 −0 includes/PHPMailer-6.1.4/src/PHPMailer.php
  63. +419 −0 includes/PHPMailer-6.1.4/src/POP3.php
  64. +1,370 −0 includes/PHPMailer-6.1.4/src/SMTP.php
  65. +0 −2,473 includes/PHPMailer_5.2.0/class.phpmailer.php
  66. +0 −410 includes/PHPMailer_5.2.0/class.pop3.php
  67. +0 −817 includes/PHPMailer_5.2.0/class.smtp.php
  68. +0 −861 includes/PHPMailer_5.2.0/extras/htmlfilter.php
  69. +0 −27 includes/PHPMailer_5.2.0/language/phpmailer.lang-ar.php
  70. +0 −26 includes/PHPMailer_5.2.0/language/phpmailer.lang-br.php
  71. +0 −26 includes/PHPMailer_5.2.0/language/phpmailer.lang-ca.php
  72. +0 −26 includes/PHPMailer_5.2.0/language/phpmailer.lang-ch.php
  73. +0 −25 includes/PHPMailer_5.2.0/language/phpmailer.lang-cz.php
  74. +0 −25 includes/PHPMailer_5.2.0/language/phpmailer.lang-de.php
  75. +0 −26 includes/PHPMailer_5.2.0/language/phpmailer.lang-es.php
  76. +0 −25 includes/PHPMailer_5.2.0/language/phpmailer.lang-fr.php
  77. +0 −25 includes/PHPMailer_5.2.0/language/phpmailer.lang-hu.php
  78. +0 −27 includes/PHPMailer_5.2.0/language/phpmailer.lang-it.php
  79. +0 −26 includes/PHPMailer_5.2.0/language/phpmailer.lang-ja.php
  80. +0 −25 includes/PHPMailer_5.2.0/language/phpmailer.lang-nl.php
  81. +0 −25 includes/PHPMailer_5.2.0/language/phpmailer.lang-no.php
  82. +0 −25 includes/PHPMailer_5.2.0/language/phpmailer.lang-pl.php
  83. +0 −27 includes/PHPMailer_5.2.0/language/phpmailer.lang-ro.php
  84. +0 −25 includes/PHPMailer_5.2.0/language/phpmailer.lang-ru.php
  85. +0 −27 includes/PHPMailer_5.2.0/language/phpmailer.lang-tr.php
  86. +0 −26 includes/PHPMailer_5.2.0/language/phpmailer.lang-zh.php
  87. +0 −26 includes/PHPMailer_5.2.0/language/phpmailer.lang-zh_cn.php
  88. +12 −12 includes/Snoopy.class.php
  89. +1 −1 includes/memcached-client.php
  90. +4 −4 includes/pqp/classes/MySqlDatabase.php
  91. +1 −1 includes/pqp/classes/PhpQuickProfiler.php
  92. +1 −1 modules/base/classes/daemon.php
  93. +20 −23 modules/base/classes/mailer.php
  94. +1 −1 modules/base/classes/resultSetManager.php
  95. +1 −1 modules/base/classes/sanitize.php
  96. +2 −2 modules/base/classes/settings.php
  97. +3 −4 owa_coreAPI.php
  98. +1 −1 owa_env.php
  99. +5 −6 owa_lib.php
  100. +1 −1 owa_template.php
  101. +1 −1 plugins/log/winstatic.php
@@ -129,7 +129,7 @@ class Services_JSON
* bubble up with an error, so all return values
* from encode() should be checked with isError()
*/
function Services_JSON($use = 0)
function __construct($use = 0)
{
$this->use = $use;
}
@@ -152,7 +152,7 @@ function utf162utf8($utf16)
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
}

$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
$bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);

switch(true) {
case ((0x7F & $bytes) == $bytes):
@@ -205,17 +205,17 @@ function utf82utf16($utf8)
case 2:
// return a UTF-16 character from a 2-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0x07 & (ord($utf8{0}) >> 2))
. chr((0xC0 & (ord($utf8{0}) << 6))
| (0x3F & ord($utf8{1})));
return chr(0x07 & (ord($utf8[0]) >> 2))
. chr((0xC0 & (ord($utf8[0]) << 6))
| (0x3F & ord($utf8[1])));

case 3:
// return a UTF-16 character from a 3-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr((0xF0 & (ord($utf8{0}) << 4))
| (0x0F & (ord($utf8{1}) >> 2)))
. chr((0xC0 & (ord($utf8{1}) << 6))
| (0x7F & ord($utf8{2})));
return chr((0xF0 & (ord($utf8[0]) << 4))
| (0x0F & (ord($utf8[1]) >> 2)))
. chr((0xC0 & (ord($utf8[1]) << 6))
| (0x7F & ord($utf8[2])));
}

// ignoring UTF-32 for now, sorry
@@ -292,7 +292,7 @@ function _encode($var)
*/
for ($c = 0; $c < $strlen_var; ++$c) {

$ord_var_c = ord($var{$c});
$ord_var_c = ord($var[$c]);

switch (true) {
case $ord_var_c == 0x08:
@@ -315,12 +315,12 @@ function _encode($var)
case $ord_var_c == 0x2F:
case $ord_var_c == 0x5C:
// double quote, slash, slosh
$ascii .= '\\'.$var{$c};
$ascii .= '\\'.$var[$c];
break;

case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
// characters U-00000000 - U-0000007F (same as ASCII)
$ascii .= $var{$c};
$ascii .= $var[$c];
break;

case (($ord_var_c & 0xE0) == 0xC0):
@@ -332,7 +332,7 @@ function _encode($var)
break;
}

$char = pack('C*', $ord_var_c, ord($var{$c + 1}));
$char = pack('C*', $ord_var_c, ord($var[$c + 1]));
$c += 1;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -347,8 +347,8 @@ function _encode($var)
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
@ord($var{$c + 1}),
@ord($var{$c + 2}));
@ord($var[$c + 1]),
@ord($var[$c + 2]));
$c += 2;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -363,9 +363,9 @@ function _encode($var)
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}));
ord($var[$c + 1]),
ord($var[$c + 2]),
ord($var[$c + 3]));
$c += 3;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -380,10 +380,10 @@ function _encode($var)
break;
}
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}),
ord($var{$c + 4}));
ord($var[$c + 1]),
ord($var[$c + 2]),
ord($var[$c + 3]),
ord($var[$c + 4]));
$c += 4;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -398,11 +398,11 @@ function _encode($var)
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}),
ord($var{$c + 4}),
ord($var{$c + 5}));
ord($var[$c + 1]),
ord($var[$c + 2]),
ord($var[$c + 3]),
ord($var[$c + 4]),
ord($var[$c + 5]));
$c += 5;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -576,7 +576,7 @@ function decode($str)
for ($c = 0; $c < $strlen_chrs; ++$c) {

$substr_chrs_c_2 = substr($chrs, $c, 2);
$ord_chrs_c = ord($chrs{$c});
$ord_chrs_c = ord($chrs[$c]);

switch (true) {
case $substr_chrs_c_2 == '\b':
@@ -606,7 +606,7 @@ function decode($str)
case $substr_chrs_c_2 == '\\/':
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
$utf8 .= $chrs{++$c};
$utf8 .= $chrs[++$c];
}
break;

@@ -619,7 +619,7 @@ function decode($str)
break;

case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
$utf8 .= $chrs{$c};
$utf8 .= $chrs[$c];
break;

case ($ord_chrs_c & 0xE0) == 0xC0:
@@ -666,7 +666,7 @@ function decode($str)
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
// array, or object notation

if ($str{0} == '[') {
if ($str[0] == '[') {
$stk = array(SERVICES_JSON_IN_ARR);
$arr = array();
} else {
@@ -705,7 +705,7 @@ function decode($str)
$top = end($stk);
$substr_chrs_c_2 = substr($chrs, $c, 2);

if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
// found a comma that is not inside a string, array, etc.,
// OR we've reached the end of the character list
$slice = substr($chrs, $top['where'], ($c - $top['where']));
@@ -747,12 +747,12 @@ function decode($str)

}

} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
} elseif ((($chrs[$c] == '"') || ($chrs[$c] == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
// found a quote, and we are not inside a string
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c]));
//print("Found start of string at {$c}\n");

} elseif (($chrs{$c} == $top['delim']) &&
} elseif (($chrs[$c] == $top['delim']) &&
($top['what'] == SERVICES_JSON_IN_STR) &&
((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
// found a quote, we're in a string, and it's not escaped
@@ -761,24 +761,24 @@ function decode($str)
array_pop($stk);
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");

} elseif (($chrs{$c} == '[') &&
} elseif (($chrs[$c] == '[') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-bracket, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
//print("Found start of array at {$c}\n");

} elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
} elseif (($chrs[$c] == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
// found a right-bracket, and we're in an array
array_pop($stk);
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");

} elseif (($chrs{$c} == '{') &&
} elseif (($chrs[$c] == '{') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-brace, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
//print("Found start of object at {$c}\n");

} elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
} elseif (($chrs[$c] == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
// found a right-brace, and we're in an object
array_pop($stk);
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
@@ -836,7 +836,7 @@ function isError($data, $code = null)

class Services_JSON_Error extends PEAR_Error
{
function Services_JSON_Error($message = 'unknown error', $code = null,
function __construct($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
@@ -850,7 +850,7 @@ function Services_JSON_Error($message = 'unknown error', $code = null,
*/
class Services_JSON_Error
{
function Services_JSON_Error($message = 'unknown error', $code = null,
function __construct($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{

@@ -0,0 +1,46 @@
GPL Cooperation Commitment
Version 1.0

Before filing or continuing to prosecute any legal proceeding or claim
(other than a Defensive Action) arising from termination of a Covered
License, we commit to extend to the person or entity ('you') accused
of violating the Covered License the following provisions regarding
cure and reinstatement, taken from GPL version 3. As used here, the
term 'this License' refers to the specific Covered License being
enforced.

However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly
and finally terminates your license, and (b) permanently, if the
copyright holder fails to notify you of the violation by some
reasonable means prior to 60 days after the cessation.

Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you
have received notice of violation of this License (for any work)
from that copyright holder, and you cure the violation prior to 30
days after your receipt of the notice.

We intend this Commitment to be irrevocable, and binding and
enforceable against us and assignees of or successors to our
copyrights.

Definitions

'Covered License' means the GNU General Public License, version 2
(GPLv2), the GNU Lesser General Public License, version 2.1
(LGPLv2.1), or the GNU Library General Public License, version 2
(LGPLv2), all as published by the Free Software Foundation.

'Defensive Action' means a legal proceeding or claim that We bring
against you in response to a prior proceeding or claim initiated by
you or your affiliate.

'We' means each contributor to this repository as of the date of
inclusion of this file, including subsidiaries of a corporate
contributor.

This work is available under a Creative Commons Attribution-ShareAlike
4.0 International license (https://creativecommons.org/licenses/by-sa/4.0/).

1 comment on commit c63b578

@padams

This comment has been minimized.

Copy link
Collaborator

@padams padams commented on c63b578 Mar 10, 2020

The changes owa_lib::formatCurrency broke installs that don't have PHP's intl extension installed. I didn't realize that NumberFormatter wasn't built-in class when i approved this. I'll push a fix now.

Please sign in to comment.
You can’t perform that action at this time.