updated dependencies

This commit is contained in:
Roland Gruber 2020-04-03 17:33:33 +02:00
parent 9cf564e500
commit 6f5a8cb0cd
50 changed files with 324 additions and 254 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
/composer.lock /composer.lock
/code-coverage/ /code-coverage/
/.phpunit.result.cache /.phpunit.result.cache
/lam/lib/3rdParty/composer/bin/

View File

@ -10,7 +10,7 @@
], ],
"require" : { "require" : {
"web-auth/webauthn-lib" : "2.1.7", "web-auth/webauthn-lib" : "2.1.7",
"symfony/http-foundation" : "5.0.0", "symfony/http-foundation" : "5.0.7",
"symfony/psr-http-message-bridge" : "1.3.0", "symfony/psr-http-message-bridge" : "1.3.0",
"pear-pear.horde.org/Horde_Imap_Client" : "2.30.1", "pear-pear.horde.org/Horde_Imap_Client" : "2.30.1",
"phpmailer/phpmailer": "~6.1" "phpmailer/phpmailer": "~6.1"

88
lam/composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "1f8fbd378084d1b9851cabba2f4ccdde", "content-hash": "2362fd1a7833247d118aed415aefe7cd",
"packages": [ "packages": [
{ {
"name": "beberlei/assert", "name": "beberlei/assert",
@ -500,17 +500,17 @@
}, },
{ {
"name": "pear-pear.horde.org/Horde_Socket_Client", "name": "pear-pear.horde.org/Horde_Socket_Client",
"version": "2.1.2", "version": "2.1.3",
"dist": { "dist": {
"type": "file", "type": "file",
"url": "https://pear.horde.org/get/Horde_Socket_Client-2.1.2.tgz" "url": "https://pear.horde.org/get/Horde_Socket_Client-2.1.3.tgz"
}, },
"require": { "require": {
"pear-pear.horde.org/horde_exception": "<3.0.0.0", "pear-pear.horde.org/horde_exception": "<3.0.0.0",
"php": "<8.0.0.0" "php": "<8.0.0.0"
}, },
"replace": { "replace": {
"pear-horde/horde_socket_client": "== 2.1.2.0" "pear-horde/horde_socket_client": "== 2.1.3.0"
}, },
"type": "pear-library", "type": "pear-library",
"autoload": { "autoload": {
@ -524,7 +524,7 @@
"license": [ "license": [
"LGPL-2.1" "LGPL-2.1"
], ],
"description": "Provides abstract class for use in creating PHP network socket clients." "description": "A library that provides an abstract PHP network socket client."
}, },
{ {
"name": "pear-pear.horde.org/Horde_Stream", "name": "pear-pear.horde.org/Horde_Stream",
@ -773,16 +773,16 @@
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v6.1.4", "version": "v6.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "c5e61d0729507049cec9673aa1a679f9adefd683" "reference": "a8bf068f64a580302026e484ee29511f661b2ad3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c5e61d0729507049cec9673aa1a679f9adefd683", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a8bf068f64a580302026e484ee29511f661b2ad3",
"reference": "c5e61d0729507049cec9673aa1a679f9adefd683", "reference": "a8bf068f64a580302026e484ee29511f661b2ad3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -831,7 +831,7 @@
} }
], ],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP", "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"time": "2019-12-10T11:17:38+00:00" "time": "2020-03-14T14:23:48+00:00"
}, },
{ {
"name": "psr/http-client", "name": "psr/http-client",
@ -1192,16 +1192,16 @@
}, },
{ {
"name": "symfony/http-foundation", "name": "symfony/http-foundation",
"version": "v5.0.0", "version": "v5.0.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-foundation.git", "url": "https://github.com/symfony/http-foundation.git",
"reference": "c5c226b6f164ae4f95c4bffbe940c81050940eda" "reference": "26fb006a2c7b6cdd23d52157b05f8414ffa417b6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/c5c226b6f164ae4f95c4bffbe940c81050940eda", "url": "https://api.github.com/repos/symfony/http-foundation/zipball/26fb006a2c7b6cdd23d52157b05f8414ffa417b6",
"reference": "c5c226b6f164ae4f95c4bffbe940c81050940eda", "reference": "26fb006a2c7b6cdd23d52157b05f8414ffa417b6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1243,20 +1243,20 @@
], ],
"description": "Symfony HttpFoundation Component", "description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-11-18T17:27:11+00:00" "time": "2020-03-30T14:14:32+00:00"
}, },
{ {
"name": "symfony/mime", "name": "symfony/mime",
"version": "v5.0.5", "version": "v5.0.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/mime.git", "url": "https://github.com/symfony/mime.git",
"reference": "9b3e5b5e58c56bbd76628c952d2b78556d305f3c" "reference": "481b7d6da88922fb1e0d86a943987722b08f3955"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/9b3e5b5e58c56bbd76628c952d2b78556d305f3c", "url": "https://api.github.com/repos/symfony/mime/zipball/481b7d6da88922fb1e0d86a943987722b08f3955",
"reference": "9b3e5b5e58c56bbd76628c952d2b78556d305f3c", "reference": "481b7d6da88922fb1e0d86a943987722b08f3955",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1305,20 +1305,20 @@
"mime", "mime",
"mime-type" "mime-type"
], ],
"time": "2020-02-04T09:41:09+00:00" "time": "2020-03-27T16:56:45+00:00"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.14.0", "version": "v1.15.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38" "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14",
"reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1330,7 +1330,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.14-dev" "dev-master": "1.15-dev"
} }
}, },
"autoload": { "autoload": {
@ -1363,20 +1363,20 @@
"polyfill", "polyfill",
"portable" "portable"
], ],
"time": "2020-01-13T11:15:53+00:00" "time": "2020-02-27T09:26:54+00:00"
}, },
{ {
"name": "symfony/polyfill-intl-idn", "name": "symfony/polyfill-intl-idn",
"version": "v1.14.0", "version": "v1.15.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git", "url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "6842f1a39cf7d580655688069a03dd7cd83d244a" "reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6842f1a39cf7d580655688069a03dd7cd83d244a", "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf",
"reference": "6842f1a39cf7d580655688069a03dd7cd83d244a", "reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1390,7 +1390,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.14-dev" "dev-master": "1.15-dev"
} }
}, },
"autoload": { "autoload": {
@ -1425,20 +1425,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2020-01-17T12:01:36+00:00" "time": "2020-03-09T19:04:49+00:00"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.14.0", "version": "v1.15.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "34094cfa9abe1f0f14f48f490772db7a775559f2" "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac",
"reference": "34094cfa9abe1f0f14f48f490772db7a775559f2", "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1450,7 +1450,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.14-dev" "dev-master": "1.15-dev"
} }
}, },
"autoload": { "autoload": {
@ -1484,20 +1484,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2020-01-13T11:15:53+00:00" "time": "2020-03-09T19:04:49+00:00"
}, },
{ {
"name": "symfony/polyfill-php72", "name": "symfony/polyfill-php72",
"version": "v1.14.0", "version": "v1.15.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php72.git", "url": "https://github.com/symfony/polyfill-php72.git",
"reference": "46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf" "reference": "37b0976c78b94856543260ce09b460a7bc852747"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf", "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/37b0976c78b94856543260ce09b460a7bc852747",
"reference": "46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf", "reference": "37b0976c78b94856543260ce09b460a7bc852747",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1506,7 +1506,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.14-dev" "dev-master": "1.15-dev"
} }
}, },
"autoload": { "autoload": {
@ -1539,7 +1539,7 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2020-01-13T11:15:53+00:00" "time": "2020-02-27T09:26:54+00:00"
}, },
{ {
"name": "symfony/psr-http-message-bridge", "name": "symfony/psr-http-message-bridge",

View File

@ -517,18 +517,18 @@
}, },
{ {
"name": "pear-pear.horde.org/Horde_Socket_Client", "name": "pear-pear.horde.org/Horde_Socket_Client",
"version": "2.1.2", "version": "2.1.3",
"version_normalized": "2.1.2.0", "version_normalized": "2.1.3.0",
"dist": { "dist": {
"type": "file", "type": "file",
"url": "https://pear.horde.org/get/Horde_Socket_Client-2.1.2.tgz" "url": "https://pear.horde.org/get/Horde_Socket_Client-2.1.3.tgz"
}, },
"require": { "require": {
"pear-pear.horde.org/horde_exception": "<3.0.0.0", "pear-pear.horde.org/horde_exception": "<3.0.0.0",
"php": "<8.0.0.0" "php": "<8.0.0.0"
}, },
"replace": { "replace": {
"pear-horde/horde_socket_client": "== 2.1.2.0" "pear-horde/horde_socket_client": "== 2.1.3.0"
}, },
"type": "pear-library", "type": "pear-library",
"installation-source": "dist", "installation-source": "dist",
@ -543,7 +543,7 @@
"license": [ "license": [
"LGPL-2.1" "LGPL-2.1"
], ],
"description": "Provides abstract class for use in creating PHP network socket clients." "description": "A library that provides an abstract PHP network socket client."
}, },
{ {
"name": "pear-pear.horde.org/Horde_Stream", "name": "pear-pear.horde.org/Horde_Stream",
@ -808,17 +808,17 @@
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v6.1.4", "version": "v6.1.5",
"version_normalized": "6.1.4.0", "version_normalized": "6.1.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "c5e61d0729507049cec9673aa1a679f9adefd683" "reference": "a8bf068f64a580302026e484ee29511f661b2ad3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c5e61d0729507049cec9673aa1a679f9adefd683", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a8bf068f64a580302026e484ee29511f661b2ad3",
"reference": "c5e61d0729507049cec9673aa1a679f9adefd683", "reference": "a8bf068f64a580302026e484ee29511f661b2ad3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -839,7 +839,7 @@
"stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)"
}, },
"time": "2019-12-10T11:17:38+00:00", "time": "2020-03-14T14:23:48+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@ -1241,17 +1241,17 @@
}, },
{ {
"name": "symfony/http-foundation", "name": "symfony/http-foundation",
"version": "v5.0.0", "version": "v5.0.7",
"version_normalized": "5.0.0.0", "version_normalized": "5.0.7.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-foundation.git", "url": "https://github.com/symfony/http-foundation.git",
"reference": "c5c226b6f164ae4f95c4bffbe940c81050940eda" "reference": "26fb006a2c7b6cdd23d52157b05f8414ffa417b6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/c5c226b6f164ae4f95c4bffbe940c81050940eda", "url": "https://api.github.com/repos/symfony/http-foundation/zipball/26fb006a2c7b6cdd23d52157b05f8414ffa417b6",
"reference": "c5c226b6f164ae4f95c4bffbe940c81050940eda", "reference": "26fb006a2c7b6cdd23d52157b05f8414ffa417b6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1263,7 +1263,7 @@
"predis/predis": "~1.0", "predis/predis": "~1.0",
"symfony/expression-language": "^4.4|^5.0" "symfony/expression-language": "^4.4|^5.0"
}, },
"time": "2019-11-18T17:27:11+00:00", "time": "2020-03-30T14:14:32+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@ -1298,17 +1298,17 @@
}, },
{ {
"name": "symfony/mime", "name": "symfony/mime",
"version": "v5.0.5", "version": "v5.0.7",
"version_normalized": "5.0.5.0", "version_normalized": "5.0.7.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/mime.git", "url": "https://github.com/symfony/mime.git",
"reference": "9b3e5b5e58c56bbd76628c952d2b78556d305f3c" "reference": "481b7d6da88922fb1e0d86a943987722b08f3955"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/9b3e5b5e58c56bbd76628c952d2b78556d305f3c", "url": "https://api.github.com/repos/symfony/mime/zipball/481b7d6da88922fb1e0d86a943987722b08f3955",
"reference": "9b3e5b5e58c56bbd76628c952d2b78556d305f3c", "reference": "481b7d6da88922fb1e0d86a943987722b08f3955",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1323,7 +1323,7 @@
"egulias/email-validator": "^2.1.10", "egulias/email-validator": "^2.1.10",
"symfony/dependency-injection": "^4.4|^5.0" "symfony/dependency-injection": "^4.4|^5.0"
}, },
"time": "2020-02-04T09:41:09+00:00", "time": "2020-03-27T16:56:45+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@ -1362,17 +1362,17 @@
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.14.0", "version": "v1.15.0",
"version_normalized": "1.14.0.0", "version_normalized": "1.15.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38" "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14",
"reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1381,11 +1381,11 @@
"suggest": { "suggest": {
"ext-ctype": "For best performance" "ext-ctype": "For best performance"
}, },
"time": "2020-01-13T11:15:53+00:00", "time": "2020-02-27T09:26:54+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.14-dev" "dev-master": "1.15-dev"
} }
}, },
"installation-source": "dist", "installation-source": "dist",
@ -1422,17 +1422,17 @@
}, },
{ {
"name": "symfony/polyfill-intl-idn", "name": "symfony/polyfill-intl-idn",
"version": "v1.14.0", "version": "v1.15.0",
"version_normalized": "1.14.0.0", "version_normalized": "1.15.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git", "url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "6842f1a39cf7d580655688069a03dd7cd83d244a" "reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6842f1a39cf7d580655688069a03dd7cd83d244a", "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf",
"reference": "6842f1a39cf7d580655688069a03dd7cd83d244a", "reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1443,11 +1443,11 @@
"suggest": { "suggest": {
"ext-intl": "For best performance" "ext-intl": "For best performance"
}, },
"time": "2020-01-17T12:01:36+00:00", "time": "2020-03-09T19:04:49+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.14-dev" "dev-master": "1.15-dev"
} }
}, },
"installation-source": "dist", "installation-source": "dist",
@ -1486,17 +1486,17 @@
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.14.0", "version": "v1.15.0",
"version_normalized": "1.14.0.0", "version_normalized": "1.15.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "34094cfa9abe1f0f14f48f490772db7a775559f2" "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac",
"reference": "34094cfa9abe1f0f14f48f490772db7a775559f2", "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1505,11 +1505,11 @@
"suggest": { "suggest": {
"ext-mbstring": "For best performance" "ext-mbstring": "For best performance"
}, },
"time": "2020-01-13T11:15:53+00:00", "time": "2020-03-09T19:04:49+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.14-dev" "dev-master": "1.15-dev"
} }
}, },
"installation-source": "dist", "installation-source": "dist",
@ -1547,27 +1547,27 @@
}, },
{ {
"name": "symfony/polyfill-php72", "name": "symfony/polyfill-php72",
"version": "v1.14.0", "version": "v1.15.0",
"version_normalized": "1.14.0.0", "version_normalized": "1.15.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php72.git", "url": "https://github.com/symfony/polyfill-php72.git",
"reference": "46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf" "reference": "37b0976c78b94856543260ce09b460a7bc852747"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf", "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/37b0976c78b94856543260ce09b460a7bc852747",
"reference": "46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf", "reference": "37b0976c78b94856543260ce09b460a7bc852747",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"time": "2020-01-13T11:15:53+00:00", "time": "2020-02-27T09:26:54+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.14-dev" "dev-master": "1.15-dev"
} }
}, },
"installation-source": "dist", "installation-source": "dist",

View File

@ -102,8 +102,8 @@ try {
$mail->SMTPAuth = true; // Enable SMTP authentication $mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'user@example.com'; // SMTP username $mail->Username = 'user@example.com'; // SMTP username
$mail->Password = 'secret'; // SMTP password $mail->Password = 'secret'; // SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` also accepted $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
$mail->Port = 587; // TCP port to connect to $mail->Port = 587; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
//Recipients //Recipients
$mail->setFrom('from@example.com', 'Mailer'); $mail->setFrom('from@example.com', 'Mailer');
@ -155,7 +155,7 @@ Note that in order to reduce PHPMailer's deployed code footprint, the examples a
Complete generated API documentation is [available online](http://phpmailer.github.io/PHPMailer/). Complete generated API documentation is [available online](http://phpmailer.github.io/PHPMailer/).
You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/phpmailerTest.php) a good source of how to do various operations such as encryption. You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good source of how to do various operations such as encryption.
If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting). If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting).

View File

@ -1 +1 @@
6.1.4 6.1.5

View File

@ -2,25 +2,27 @@
/** /**
* Danish PHPMailer language file: refer to English translation for definitive list * Danish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
* @author Mikael Stokkebro <info@stokkebro.dk> * @author John Sebastian <jms@iwb.dk>
* Rewrite and extension of the work by Mikael Stokkebro <info@stokkebro.dk>
*
*/ */
$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge på.'; $PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.';
$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.'; $PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; $PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold';
$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; $PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: ';
$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: '; $PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: ';
$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: '; $PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: ';
$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; $PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: ';
$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; $PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: ';
$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.'; $PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.';
//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; $PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';
$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.'; $PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; $PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: '; $PHPMAILER_LANG['signing'] = 'Signeringsfejl: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; $PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; $PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: ';

View File

@ -64,7 +64,7 @@ class PHPMailer
* Options: null (default), 1 = High, 3 = Normal, 5 = low. * Options: null (default), 1 = High, 3 = Normal, 5 = low.
* When null, the header is not set at all. * When null, the header is not set at all.
* *
* @var int * @var int|null
*/ */
public $Priority; public $Priority;
@ -745,7 +745,7 @@ class PHPMailer
* *
* @var string * @var string
*/ */
const VERSION = '6.1.4'; const VERSION = '6.1.5';
/** /**
* Error severity: message only, continue processing. * Error severity: message only, continue processing.
@ -769,11 +769,22 @@ class PHPMailer
const STOP_CRITICAL = 2; const STOP_CRITICAL = 2;
/** /**
* SMTP RFC standard line ending. * The SMTP standard CRLF line break.
* If you want to change line break format, change static::$LE, not this.
*/
const CRLF = "\r\n";
/**
* "Folding White Space" a white space string used for line folding.
*/
const FWS = ' ';
/**
* SMTP RFC standard line ending; Carriage Return, Line Feed.
* *
* @var string * @var string
*/ */
protected static $LE = "\r\n"; protected static $LE = self::CRLF;
/** /**
* The maximum line length supported by mail(). * The maximum line length supported by mail().
@ -1446,7 +1457,7 @@ class PHPMailer
) { ) {
//SMTP mandates RFC-compliant line endings //SMTP mandates RFC-compliant line endings
//and it's also used with mail() on Windows //and it's also used with mail() on Windows
static::setLE("\r\n"); static::setLE(self::CRLF);
} else { } else {
//Maintain backward compatibility with legacy Linux command line mailers //Maintain backward compatibility with legacy Linux command line mailers
static::setLE(PHP_EOL); static::setLE(PHP_EOL);
@ -1553,7 +1564,7 @@ class PHPMailer
$this->encodeHeader($this->secureHeader($this->Subject)), $this->encodeHeader($this->secureHeader($this->Subject)),
$this->MIMEBody $this->MIMEBody
); );
$this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . static::$LE . $this->MIMEHeader = static::stripTrailingWSP($this->MIMEHeader) . static::$LE .
static::normalizeBreaks($header_dkim) . static::$LE; static::normalizeBreaks($header_dkim) . static::$LE;
} }
@ -1620,7 +1631,7 @@ class PHPMailer
*/ */
protected function sendmailSend($header, $body) protected function sendmailSend($header, $body)
{ {
$header = rtrim($header, "\r\n ") . static::$LE . static::$LE; $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;
// CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
if (!empty($this->Sender) && self::isShellSafe($this->Sender)) { if (!empty($this->Sender) && self::isShellSafe($this->Sender)) {
@ -1750,7 +1761,7 @@ class PHPMailer
*/ */
protected function mailSend($header, $body) protected function mailSend($header, $body)
{ {
$header = rtrim($header, "\r\n ") . static::$LE . static::$LE; $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;
$toArr = []; $toArr = [];
foreach ($this->to as $toaddr) { foreach ($this->to as $toaddr) {
@ -1839,7 +1850,7 @@ class PHPMailer
*/ */
protected function smtpSend($header, $body) protected function smtpSend($header, $body)
{ {
$header = rtrim($header, "\r\n ") . static::$LE . static::$LE; $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;
$bad_rcpt = []; $bad_rcpt = [];
if (!$this->smtpConnect($this->SMTPOptions)) { if (!$this->smtpConnect($this->SMTPOptions)) {
throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
@ -2511,7 +2522,8 @@ class PHPMailer
*/ */
public function getSentMIMEMessage() public function getSentMIMEMessage()
{ {
return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . static::$LE . static::$LE . $this->MIMEBody; return static::stripTrailingWSP($this->MIMEHeader . $this->mailHeader) .
static::$LE . static::$LE . $this->MIMEBody;
} }
/** /**
@ -2594,7 +2606,7 @@ class PHPMailer
$altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE; $altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE;
} }
//Use this as a preamble in all multipart message types //Use this as a preamble in all multipart message types
$mimepre = 'This is a multi-part message in MIME format.' . static::$LE; $mimepre = 'This is a multi-part message in MIME format.' . static::$LE . static::$LE;
switch ($this->message_type) { switch ($this->message_type) {
case 'inline': case 'inline':
$body .= $mimepre; $body .= $mimepre;
@ -2949,7 +2961,7 @@ class PHPMailer
$disposition = 'attachment' $disposition = 'attachment'
) { ) {
try { try {
if (!static::isPermittedPath($path) || !@is_file($path)) { if (!static::isPermittedPath($path) || !@is_file($path) || !is_readable($path)) {
throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE);
} }
@ -3134,7 +3146,7 @@ class PHPMailer
protected function encodeFile($path, $encoding = self::ENCODING_BASE64) protected function encodeFile($path, $encoding = self::ENCODING_BASE64)
{ {
try { try {
if (!static::isPermittedPath($path) || !file_exists($path)) { if (!static::isPermittedPath($path) || !file_exists($path) || !is_readable($path)) {
throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE); throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE);
} }
$file_buffer = file_get_contents($path); $file_buffer = file_get_contents($path);
@ -3146,7 +3158,10 @@ class PHPMailer
return $file_buffer; return $file_buffer;
} catch (Exception $exc) { } catch (Exception $exc) {
$this->setError($exc->getMessage()); $this->setError($exc->getMessage());
$this->edebug($exc->getMessage());
if ($this->exceptions) {
throw $exc;
}
return ''; return '';
} }
} }
@ -3516,7 +3531,7 @@ class PHPMailer
$disposition = 'inline' $disposition = 'inline'
) { ) {
try { try {
if (!static::isPermittedPath($path) || !@is_file($path)) { if (!static::isPermittedPath($path) || !@is_file($path) || !is_readable($path)) {
throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE);
} }
@ -3935,15 +3950,28 @@ class PHPMailer
* *
* @param string $name Custom header name * @param string $name Custom header name
* @param string|null $value Header value * @param string|null $value Header value
*
* @throws Exception
*/ */
public function addCustomHeader($name, $value = null) public function addCustomHeader($name, $value = null)
{ {
if (null === $value) { if (null === $value && strpos($name, ':') !== false) {
// Value passed in as name:value // Value passed in as name:value
$this->CustomHeader[] = explode(':', $name, 2); list($name, $value) = explode(':', $name, 2);
} else {
$this->CustomHeader[] = [$name, $value];
} }
$name = trim($name);
$value = trim($value);
//Ensure name is not empty, and that neither name nor value contain line breaks
if (empty($name) || strpbrk($name . $value, "\r\n") !== false) {
if ($this->exceptions) {
throw new Exception('Invalid header name or value');
}
return false;
}
$this->CustomHeader[] = [$name, $value];
return true;
} }
/** /**
@ -3987,6 +4015,7 @@ class PHPMailer
foreach ($images[2] as $imgindex => $url) { foreach ($images[2] as $imgindex => $url) {
// Convert data URIs into embedded images // Convert data URIs into embedded images
//e.g. "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" //e.g. "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
$match = [];
if (preg_match('#^data:(image/(?:jpe?g|gif|png));?(base64)?,(.+)#', $url, $match)) { if (preg_match('#^data:(image/(?:jpe?g|gif|png));?(base64)?,(.+)#', $url, $match)) {
if (count($match) === 4 && static::ENCODING_BASE64 === $match[2]) { if (count($match) === 4 && static::ENCODING_BASE64 === $match[2]) {
$data = base64_decode($match[3]); $data = base64_decode($match[3]);
@ -4355,7 +4384,7 @@ class PHPMailer
$breaktype = static::$LE; $breaktype = static::$LE;
} }
// Normalise to \n // Normalise to \n
$text = str_replace(["\r\n", "\r"], "\n", $text); $text = str_replace([self::CRLF, "\r"], "\n", $text);
// Now convert LE as needed // Now convert LE as needed
if ("\n" !== $breaktype) { if ("\n" !== $breaktype) {
$text = str_replace("\n", $breaktype, $text); $text = str_replace("\n", $breaktype, $text);
@ -4364,6 +4393,18 @@ class PHPMailer
return $text; return $text;
} }
/**
* Remove trailing breaks from a string.
*
* @param string $text
*
* @return string The text to remove breaks from
*/
public static function stripTrailingWSP($text)
{
return rtrim($text, " \r\n\t");
}
/** /**
* Return the current line break format string. * Return the current line break format string.
* *
@ -4472,13 +4513,15 @@ class PHPMailer
*/ */
public function DKIM_HeaderC($signHeader) public function DKIM_HeaderC($signHeader)
{ {
//Normalize breaks to CRLF (regardless of the mailer)
$signHeader = static::normalizeBreaks($signHeader, self::CRLF);
//Unfold header lines
//Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]` //Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]`
//@see https://tools.ietf.org/html/rfc5322#section-2.2 //@see https://tools.ietf.org/html/rfc5322#section-2.2
//That means this may break if you do something daft like put vertical tabs in your headers. //That means this may break if you do something daft like put vertical tabs in your headers.
//Unfold header lines
$signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader); $signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader);
//Break headers out into an array //Break headers out into an array
$lines = explode("\r\n", $signHeader); $lines = explode(self::CRLF, $signHeader);
foreach ($lines as $key => $line) { foreach ($lines as $key => $line) {
//If the header is missing a :, skip it as it's invalid //If the header is missing a :, skip it as it's invalid
//This is likely to happen because the explode() above will also split //This is likely to happen because the explode() above will also split
@ -4498,7 +4541,7 @@ class PHPMailer
$lines[$key] = trim($heading, " \t") . ':' . trim($value, " \t"); $lines[$key] = trim($heading, " \t") . ':' . trim($value, " \t");
} }
return implode("\r\n", $lines); return implode(self::CRLF, $lines);
} }
/** /**
@ -4515,13 +4558,13 @@ class PHPMailer
public function DKIM_BodyC($body) public function DKIM_BodyC($body)
{ {
if (empty($body)) { if (empty($body)) {
return "\r\n"; return self::CRLF;
} }
// Normalize line endings to CRLF // Normalize line endings to CRLF
$body = static::normalizeBreaks($body, "\r\n"); $body = static::normalizeBreaks($body, self::CRLF);
//Reduce multiple trailing line breaks to a single one //Reduce multiple trailing line breaks to a single one
return rtrim($body, "\r\n") . "\r\n"; return static::stripTrailingWSP($body) . self::CRLF;
} }
/** /**
@ -4542,17 +4585,18 @@ class PHPMailer
$DKIMquery = 'dns/txt'; // Query method $DKIMquery = 'dns/txt'; // Query method
$DKIMtime = time(); $DKIMtime = time();
//Always sign these headers without being asked //Always sign these headers without being asked
//Recommended list from https://tools.ietf.org/html/rfc6376#section-5.4.1
$autoSignHeaders = [ $autoSignHeaders = [
'From', 'from',
'To', 'to',
'CC', 'cc',
'Date', 'date',
'Subject', 'subject',
'Reply-To', 'reply-to',
'Message-ID', 'message-id',
'Content-Type', 'content-type',
'Mime-Version', 'mime-version',
'X-Mailer', 'x-mailer',
]; ];
if (stripos($headers_line, 'Subject') === false) { if (stripos($headers_line, 'Subject') === false) {
$headers_line .= 'Subject: ' . $subject . static::$LE; $headers_line .= 'Subject: ' . $subject . static::$LE;
@ -4587,7 +4631,7 @@ class PHPMailer
$headersToSign = []; $headersToSign = [];
foreach ($parsedHeaders as $header) { foreach ($parsedHeaders as $header) {
//Is this header one that must be included in the DKIM signature? //Is this header one that must be included in the DKIM signature?
if (in_array($header['label'], $autoSignHeaders, true)) { if (in_array(strtolower($header['label']), $autoSignHeaders, true)) {
$headersToSignKeys[] = $header['label']; $headersToSignKeys[] = $header['label'];
$headersToSign[] = $header['label'] . ': ' . $header['value']; $headersToSign[] = $header['label'] . ': ' . $header['value'];
if ($this->DKIM_copyHeaderFields) { if ($this->DKIM_copyHeaderFields) {
@ -4625,9 +4669,9 @@ class PHPMailer
//Fold long values //Fold long values
if (strlen($copiedHeader) > self::STD_LINE_LENGTH - 3) { if (strlen($copiedHeader) > self::STD_LINE_LENGTH - 3) {
$copiedHeaderFields .= substr( $copiedHeaderFields .= substr(
chunk_split($copiedHeader, self::STD_LINE_LENGTH - 3, static::$LE . ' '), chunk_split($copiedHeader, self::STD_LINE_LENGTH - 3, static::$LE . self::FWS),
0, 0,
-strlen(static::$LE . ' ') -strlen(static::$LE . self::FWS)
); );
} else { } else {
$copiedHeaderFields .= $copiedHeader; $copiedHeaderFields .= $copiedHeader;
@ -4639,7 +4683,6 @@ class PHPMailer
$headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE; $headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE;
$headerValues = implode(static::$LE, $headersToSign); $headerValues = implode(static::$LE, $headersToSign);
$body = $this->DKIM_BodyC($body); $body = $this->DKIM_BodyC($body);
$DKIMlen = strlen($body); // Length of body
$DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body
$ident = ''; $ident = '';
if ('' !== $this->DKIM_identity) { if ('' !== $this->DKIM_identity) {
@ -4653,7 +4696,6 @@ class PHPMailer
' s=' . $this->DKIM_selector . ';' . static::$LE . ' s=' . $this->DKIM_selector . ';' . static::$LE .
' a=' . $DKIMsignatureType . ';' . ' a=' . $DKIMsignatureType . ';' .
' q=' . $DKIMquery . ';' . ' q=' . $DKIMquery . ';' .
' l=' . $DKIMlen . ';' .
' t=' . $DKIMtime . ';' . ' t=' . $DKIMtime . ';' .
' c=' . $DKIMcanonicalization . ';' . static::$LE . ' c=' . $DKIMcanonicalization . ';' . static::$LE .
$headerKeys . $headerKeys .
@ -4666,9 +4708,9 @@ class PHPMailer
$headerValues . static::$LE . $dkimSignatureHeader $headerValues . static::$LE . $dkimSignatureHeader
); );
$signature = $this->DKIM_Sign($canonicalizedHeaders); $signature = $this->DKIM_Sign($canonicalizedHeaders);
$signature = trim(chunk_split($signature, self::STD_LINE_LENGTH - 3, static::$LE . ' ')); $signature = trim(chunk_split($signature, self::STD_LINE_LENGTH - 3, static::$LE . self::FWS));
return static::normalizeBreaks($dkimSignatureHeader . $signature) . static::$LE; return static::normalizeBreaks($dkimSignatureHeader . $signature);
} }
/** /**

View File

@ -45,7 +45,7 @@ class POP3
* *
* @var string * @var string
*/ */
const VERSION = '6.1.4'; const VERSION = '6.1.5';
/** /**
* Default POP3 port number. * Default POP3 port number.
@ -230,6 +230,8 @@ class POP3
} }
// connect to the POP3 server // connect to the POP3 server
$errno = 0;
$errstr = '';
$this->pop_conn = fsockopen( $this->pop_conn = fsockopen(
$host, // POP3 Host $host, // POP3 Host
$port, // Port # $port, // Port #

View File

@ -34,7 +34,7 @@ class SMTP
* *
* @var string * @var string
*/ */
const VERSION = '6.1.4'; const VERSION = '6.1.5';
/** /**
* SMTP line break constant. * SMTP line break constant.
@ -1344,6 +1344,7 @@ class SMTP
} else { } else {
$this->last_smtp_transaction_id = false; $this->last_smtp_transaction_id = false;
foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) { foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
$matches = [];
if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) { if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
$this->last_smtp_transaction_id = trim($matches[1]); $this->last_smtp_transaction_id = trim($matches[1]);
break; break;

View File

@ -1,3 +0,0 @@
/Tests export-ignore
/phpunit.xml.dist export-ignore
/.gitignore export-ignore

View File

@ -11,6 +11,9 @@
namespace Symfony\Component\HttpFoundation; namespace Symfony\Component\HttpFoundation;
// Help opcache.preload discover always-needed symbols
class_exists(AcceptHeaderItem::class);
/** /**
* Represents an Accept-* header. * Represents an Accept-* header.
* *

View File

@ -214,7 +214,7 @@ class BinaryFileResponse extends Response
} }
if ('x-accel-redirect' === strtolower($type)) { if ('x-accel-redirect' === strtolower($type)) {
// Do X-Accel-Mapping substitutions. // Do X-Accel-Mapping substitutions.
// @link http://wiki.nginx.org/X-accel#X-Accel-Redirect // @link https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/#x-accel-redirect
$parts = HeaderUtils::split($request->headers->get('X-Accel-Mapping', ''), ',='); $parts = HeaderUtils::split($request->headers->get('X-Accel-Mapping', ''), ',=');
foreach ($parts as $part) { foreach ($parts as $part) {
list($pathPrefix, $location) = $part; list($pathPrefix, $location) = $part;
@ -340,7 +340,7 @@ class BinaryFileResponse extends Response
} }
/** /**
* If this is set to true, the file will be unlinked after the request is send * If this is set to true, the file will be unlinked after the request is sent
* Note: If the X-Sendfile header is used, the deleteFileAfterSend setting will not be used. * Note: If the X-Sendfile header is used, the deleteFileAfterSend setting will not be used.
* *
* @return $this * @return $this

View File

@ -17,6 +17,9 @@ CHANGELOG
* passing arguments to `Request::isMethodSafe()` is deprecated. * passing arguments to `Request::isMethodSafe()` is deprecated.
* `ApacheRequest` is deprecated, use the `Request` class instead. * `ApacheRequest` is deprecated, use the `Request` class instead.
* passing a third argument to `HeaderBag::get()` is deprecated, use method `all()` instead * passing a third argument to `HeaderBag::get()` is deprecated, use method `all()` instead
* [BC BREAK] `PdoSessionHandler` with MySQL changed the type of the lifetime column,
make sure to run `ALTER TABLE sessions MODIFY sess_lifetime INTEGER UNSIGNED NOT NULL` to
update your database.
* `PdoSessionHandler` now precalculates the expiry timestamp in the lifetime column, * `PdoSessionHandler` now precalculates the expiry timestamp in the lifetime column,
make sure to run `CREATE INDEX EXPIRY ON sessions (sess_lifetime)` to update your database make sure to run `CREATE INDEX EXPIRY ON sessions (sess_lifetime)` to update your database
to speed up garbage collection of expired sessions. to speed up garbage collection of expired sessions.

View File

@ -88,7 +88,7 @@ class File extends \SplFileInfo
$renamed = rename($this->getPathname(), $target); $renamed = rename($this->getPathname(), $target);
restore_error_handler(); restore_error_handler();
if (!$renamed) { if (!$renamed) {
throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error))); throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error)));
} }
@chmod($target, 0666 & ~umask()); @chmod($target, 0666 & ~umask());
@ -103,10 +103,10 @@ class File extends \SplFileInfo
{ {
if (!is_dir($directory)) { if (!is_dir($directory)) {
if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) { if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) {
throw new FileException(sprintf('Unable to create the "%s" directory', $directory)); throw new FileException(sprintf('Unable to create the "%s" directory.', $directory));
} }
} elseif (!is_writable($directory)) { } elseif (!is_writable($directory)) {
throw new FileException(sprintf('Unable to write in the "%s" directory', $directory)); throw new FileException(sprintf('Unable to write in the "%s" directory.', $directory));
} }
$target = rtrim($directory, '/\\').\DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name)); $target = rtrim($directory, '/\\').\DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name));

View File

@ -181,7 +181,7 @@ class UploadedFile extends File
$moved = move_uploaded_file($this->getPathname(), $target); $moved = move_uploaded_file($this->getPathname(), $target);
restore_error_handler(); restore_error_handler();
if (!$moved) { if (!$moved) {
throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error))); throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error)));
} }
@chmod($target, 0666 & ~umask()); @chmod($target, 0666 & ~umask());

View File

@ -199,7 +199,7 @@ class HeaderBag implements \IteratorAggregate, \Countable
} }
if (false === $date = \DateTime::createFromFormat(DATE_RFC2822, $value)) { if (false === $date = \DateTime::createFromFormat(DATE_RFC2822, $value)) {
throw new \RuntimeException(sprintf('The %s HTTP header is not parseable (%s).', $key, $value)); throw new \RuntimeException(sprintf('The "%s" HTTP header is not parseable (%s).', $key, $value));
} }
return $date; return $date;

View File

@ -1,4 +1,4 @@
Copyright (c) 2004-2019 Fabien Potencier Copyright (c) 2004-2020 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -7,7 +7,7 @@ specification.
Resources Resources
--------- ---------
* [Documentation](https://symfony.com/doc/current/components/http_foundation/index.html) * [Documentation](https://symfony.com/doc/current/components/http_foundation.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html) * [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and * [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls) [send Pull Requests](https://github.com/symfony/symfony/pulls)

View File

@ -42,7 +42,7 @@ class RedirectResponse extends Response
throw new \InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).', $status)); throw new \InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).', $status));
} }
if (301 == $status && !\array_key_exists('cache-control', array_change_key_case($headers, \CASE_LOWER))) { if (301 == $status && !\array_key_exists('cache-control', array_change_key_case($headers, CASE_LOWER))) {
$this->headers->remove('cache-control'); $this->headers->remove('cache-control');
} }
} }

View File

@ -15,6 +15,14 @@ use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException;
use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException; use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
// Help opcache.preload discover always-needed symbols
class_exists(AcceptHeader::class);
class_exists(FileBag::class);
class_exists(HeaderBag::class);
class_exists(HeaderUtils::class);
class_exists(ParameterBag::class);
class_exists(ServerBag::class);
/** /**
* Request represents an HTTP request. * Request represents an HTTP request.
* *
@ -1553,24 +1561,23 @@ class Request
* Gets the preferred format for the response by inspecting, in the following order: * Gets the preferred format for the response by inspecting, in the following order:
* * the request format set using setRequestFormat * * the request format set using setRequestFormat
* * the values of the Accept HTTP header * * the values of the Accept HTTP header
* * the content type of the body of the request. *
* Note that if you use this method, you should send the "Vary: Accept" header
* in the response to prevent any issues with intermediary HTTP caches.
*/ */
public function getPreferredFormat(?string $default = 'html'): ?string public function getPreferredFormat(?string $default = 'html'): ?string
{ {
if (null !== $this->preferredFormat) { if (null !== $this->preferredFormat || null !== $this->preferredFormat = $this->getRequestFormat(null)) {
return $this->preferredFormat; return $this->preferredFormat;
} }
$preferredFormat = null; foreach ($this->getAcceptableContentTypes() as $mimeType) {
foreach ($this->getAcceptableContentTypes() as $contentType) { if ($this->preferredFormat = $this->getFormat($mimeType)) {
if ($preferredFormat = $this->getFormat($contentType)) { return $this->preferredFormat;
break;
} }
} }
$this->preferredFormat = $this->getRequestFormat($preferredFormat ?: $this->getContentType()); return $default;
return $this->preferredFormat ?: $default;
} }
/** /**

View File

@ -11,6 +11,9 @@
namespace Symfony\Component\HttpFoundation; namespace Symfony\Component\HttpFoundation;
// Help opcache.preload discover always-needed symbols
class_exists(ResponseHeaderBag::class);
/** /**
* Response represents an HTTP response. * Response represents an HTTP response.
* *
@ -258,10 +261,12 @@ class Response
$this->setContent(null); $this->setContent(null);
$headers->remove('Content-Type'); $headers->remove('Content-Type');
$headers->remove('Content-Length'); $headers->remove('Content-Length');
// prevent PHP from sending the Content-Type header based on default_mimetype
ini_set('default_mimetype', '');
} else { } else {
// Content-type based on the Request // Content-type based on the Request
if (!$headers->has('Content-Type')) { if (!$headers->has('Content-Type')) {
$format = $request->getPreferredFormat(); $format = $request->getRequestFormat(null);
if (null !== $format && $mimeType = $request->getMimeType($format)) { if (null !== $format && $mimeType = $request->getMimeType($format)) {
$headers->set('Content-Type', $mimeType); $headers->set('Content-Type', $mimeType);
} }
@ -611,7 +616,7 @@ class Response
} }
/** /**
* Returns true if the response must be revalidated by caches. * Returns true if the response must be revalidated by shared caches once it has become stale.
* *
* This method indicates that the response must not be served stale by a * This method indicates that the response must not be served stale by a
* cache in any circumstance without first revalidating with the origin. * cache in any circumstance without first revalidating with the origin.

View File

@ -239,9 +239,9 @@ class ResponseHeaderBag extends HeaderBag
/** /**
* Clears a cookie in the browser. * Clears a cookie in the browser.
*/ */
public function clearCookie(string $name, ?string $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true) public function clearCookie(string $name, ?string $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true, string $sameSite = null)
{ {
$this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly, false, null)); $this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly, false, $sameSite));
} }
/** /**
@ -262,13 +262,13 @@ class ResponseHeaderBag extends HeaderBag
*/ */
protected function computeCacheControlValue() protected function computeCacheControlValue()
{ {
if (!$this->cacheControl && !$this->has('ETag') && !$this->has('Last-Modified') && !$this->has('Expires')) { if (!$this->cacheControl) {
return 'no-cache, private'; if ($this->has('Last-Modified') || $this->has('Expires')) {
return 'private, must-revalidate'; // allows for heuristic expiration (RFC 7234 Section 4.2.2) in the case of "Last-Modified"
} }
if (!$this->cacheControl) {
// conservative by default // conservative by default
return 'private, must-revalidate'; return 'no-cache, private';
} }
$header = $this->getCacheControlHeader(); $header = $this->getCacheControlHeader();

View File

@ -43,13 +43,13 @@ class ServerBag extends ParameterBag
/* /*
* php-cgi under Apache does not pass HTTP Basic user/pass to PHP by default * php-cgi under Apache does not pass HTTP Basic user/pass to PHP by default
* For this workaround to work, add these lines to your .htaccess file: * For this workaround to work, add these lines to your .htaccess file:
* RewriteCond %{HTTP:Authorization} ^(.+)$ * RewriteCond %{HTTP:Authorization} .+
* RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] * RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]
* *
* A sample .htaccess file: * A sample .htaccess file:
* RewriteEngine On * RewriteEngine On
* RewriteCond %{HTTP:Authorization} ^(.+)$ * RewriteCond %{HTTP:Authorization} .+
* RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] * RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]
* RewriteCond %{REQUEST_FILENAME} !-f * RewriteCond %{REQUEST_FILENAME} !-f
* RewriteRule ^(.*)$ app.php [QSA,L] * RewriteRule ^(.*)$ app.php [QSA,L]
*/ */

View File

@ -18,6 +18,11 @@ use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface; use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface;
// Help opcache.preload discover always-needed symbols
class_exists(AttributeBag::class);
class_exists(FlashBag::class);
class_exists(SessionBagProxy::class);
/** /**
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
* @author Drak <drak@zikula.org> * @author Drak <drak@zikula.org>

View File

@ -114,7 +114,7 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess
{ {
if (!headers_sent() && filter_var(ini_get('session.use_cookies'), FILTER_VALIDATE_BOOLEAN)) { if (!headers_sent() && filter_var(ini_get('session.use_cookies'), FILTER_VALIDATE_BOOLEAN)) {
if (!$this->sessionName) { if (!$this->sessionName) {
throw new \LogicException(sprintf('Session name cannot be empty, did you forget to call "parent::open()" in "%s"?.', \get_class($this))); throw new \LogicException(sprintf('Session name cannot be empty, did you forget to call "parent::open()" in "%s"?.', static::class));
} }
$cookie = SessionUtils::popSessionCookie($this->sessionName, $sessionId); $cookie = SessionUtils::popSessionCookie($this->sessionName, $sessionId);

View File

@ -47,7 +47,7 @@ class MemcachedSessionHandler extends AbstractSessionHandler
$this->memcached = $memcached; $this->memcached = $memcached;
if ($diff = array_diff(array_keys($options), ['prefix', 'expiretime'])) { if ($diff = array_diff(array_keys($options), ['prefix', 'expiretime'])) {
throw new \InvalidArgumentException(sprintf('The following options are not supported "%s"', implode(', ', $diff))); throw new \InvalidArgumentException(sprintf('The following options are not supported "%s".', implode(', ', $diff)));
} }
$this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400; $this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400;

View File

@ -66,7 +66,7 @@ class MongoDbSessionHandler extends AbstractSessionHandler
public function __construct(\MongoDB\Client $mongo, array $options) public function __construct(\MongoDB\Client $mongo, array $options)
{ {
if (!isset($options['database']) || !isset($options['collection'])) { if (!isset($options['database']) || !isset($options['collection'])) {
throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler'); throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler.');
} }
$this->mongo = $mongo; $this->mongo = $mongo;

View File

@ -38,7 +38,7 @@ class NativeFileSessionHandler extends \SessionHandler
if ($count = substr_count($savePath, ';')) { if ($count = substr_count($savePath, ';')) {
if ($count > 2) { if ($count > 2) {
throw new \InvalidArgumentException(sprintf('Invalid argument $savePath \'%s\'', $savePath)); throw new \InvalidArgumentException(sprintf('Invalid argument $savePath \'%s\'.', $savePath));
} }
// characters after last ';' are the path // characters after last ';' are the path
@ -46,7 +46,7 @@ class NativeFileSessionHandler extends \SessionHandler
} }
if ($baseDir && !is_dir($baseDir) && !@mkdir($baseDir, 0777, true) && !is_dir($baseDir)) { if ($baseDir && !is_dir($baseDir) && !@mkdir($baseDir, 0777, true) && !is_dir($baseDir)) {
throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s"', $baseDir)); throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s".', $baseDir));
} }
ini_set('session.save_path', $savePath); ini_set('session.save_path', $savePath);

View File

@ -174,7 +174,7 @@ class PdoSessionHandler extends AbstractSessionHandler
{ {
if ($pdoOrDsn instanceof \PDO) { if ($pdoOrDsn instanceof \PDO) {
if (\PDO::ERRMODE_EXCEPTION !== $pdoOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) { if (\PDO::ERRMODE_EXCEPTION !== $pdoOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) {
throw new \InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION))', __CLASS__)); throw new \InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION)).', __CLASS__));
} }
$this->pdo = $pdoOrDsn; $this->pdo = $pdoOrDsn;
@ -219,7 +219,7 @@ class PdoSessionHandler extends AbstractSessionHandler
// - trailing space removal // - trailing space removal
// - case-insensitivity // - case-insensitivity
// - language processing like é == e // - language processing like é == e
$sql = "CREATE TABLE $this->table ($this->idCol VARBINARY(128) NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER UNSIGNED NOT NULL, $this->timeCol INTEGER UNSIGNED NOT NULL) COLLATE utf8_bin, ENGINE = InnoDB"; $sql = "CREATE TABLE $this->table ($this->idCol VARBINARY(128) NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER UNSIGNED NOT NULL, $this->timeCol INTEGER UNSIGNED NOT NULL) COLLATE utf8mb4_bin, ENGINE = InnoDB";
break; break;
case 'sqlite': case 'sqlite':
$sql = "CREATE TABLE $this->table ($this->idCol TEXT NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)"; $sql = "CREATE TABLE $this->table ($this->idCol TEXT NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)";
@ -468,7 +468,7 @@ class PdoSessionHandler extends AbstractSessionHandler
} }
if (!isset($params['scheme'])) { if (!isset($params['scheme'])) {
throw new \InvalidArgumentException('URLs without scheme are not supported to configure the PdoSessionHandler'); throw new \InvalidArgumentException('URLs without scheme are not supported to configure the PdoSessionHandler.');
} }
$driverAliasMap = [ $driverAliasMap = [
@ -869,10 +869,10 @@ class PdoSessionHandler extends AbstractSessionHandler
$mergeStmt->bindParam(2, $sessionId, \PDO::PARAM_STR); $mergeStmt->bindParam(2, $sessionId, \PDO::PARAM_STR);
$mergeStmt->bindParam(3, $data, \PDO::PARAM_LOB); $mergeStmt->bindParam(3, $data, \PDO::PARAM_LOB);
$mergeStmt->bindValue(4, time() + $maxlifetime, \PDO::PARAM_INT); $mergeStmt->bindValue(4, time() + $maxlifetime, \PDO::PARAM_INT);
$mergeStmt->bindValue(4, time(), \PDO::PARAM_INT); $mergeStmt->bindValue(5, time(), \PDO::PARAM_INT);
$mergeStmt->bindParam(5, $data, \PDO::PARAM_LOB); $mergeStmt->bindParam(6, $data, \PDO::PARAM_LOB);
$mergeStmt->bindValue(6, time() + $maxlifetime, \PDO::PARAM_INT); $mergeStmt->bindValue(7, time() + $maxlifetime, \PDO::PARAM_INT);
$mergeStmt->bindValue(6, time(), \PDO::PARAM_INT); $mergeStmt->bindValue(8, time(), \PDO::PARAM_INT);
} else { } else {
$mergeStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); $mergeStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);
$mergeStmt->bindParam(':data', $data, \PDO::PARAM_LOB); $mergeStmt->bindParam(':data', $data, \PDO::PARAM_LOB);

View File

@ -54,16 +54,16 @@ class RedisSessionHandler extends AbstractSessionHandler
!$redis instanceof RedisProxy && !$redis instanceof RedisProxy &&
!$redis instanceof RedisClusterProxy !$redis instanceof RedisClusterProxy
) { ) {
throw new \InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis))); throw new \InvalidArgumentException(sprintf('"%s()" expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, "%s" given.', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis)));
} }
if ($diff = array_diff(array_keys($options), ['prefix', 'ttl'])) { if ($diff = array_diff(array_keys($options), ['prefix', 'ttl'])) {
throw new \InvalidArgumentException(sprintf('The following options are not supported "%s"', implode(', ', $diff))); throw new \InvalidArgumentException(sprintf('The following options are not supported "%s".', implode(', ', $diff)));
} }
$this->redis = $redis; $this->redis = $redis;
$this->prefix = $options['prefix'] ?? 'sf_s'; $this->prefix = $options['prefix'] ?? 'sf_s';
$this->ttl = $options['ttl'] ?? (int) ini_get('session.gc_maxlifetime'); $this->ttl = $options['ttl'] ?? null;
} }
/** /**
@ -79,7 +79,7 @@ class RedisSessionHandler extends AbstractSessionHandler
*/ */
protected function doWrite(string $sessionId, string $data): bool protected function doWrite(string $sessionId, string $data): bool
{ {
$result = $this->redis->setEx($this->prefix.$sessionId, $this->ttl, $data); $result = $this->redis->setEx($this->prefix.$sessionId, (int) ($this->ttl ?? ini_get('session.gc_maxlifetime')), $data);
return $result && !$result instanceof ErrorInterface; return $result && !$result instanceof ErrorInterface;
} }
@ -115,6 +115,6 @@ class RedisSessionHandler extends AbstractSessionHandler
*/ */
public function updateTimestamp($sessionId, $data) public function updateTimestamp($sessionId, $data)
{ {
return (bool) $this->redis->expire($this->prefix.$sessionId, $this->ttl); return (bool) $this->redis->expire($this->prefix.$sessionId, (int) ($this->ttl ?? ini_get('session.gc_maxlifetime')));
} }
} }

View File

@ -27,7 +27,7 @@ class SessionHandlerFactory
public static function createHandler($connection): AbstractSessionHandler public static function createHandler($connection): AbstractSessionHandler
{ {
if (!\is_string($connection) && !\is_object($connection)) { if (!\is_string($connection) && !\is_object($connection)) {
throw new \TypeError(sprintf('Argument 1 passed to %s() must be a string or a connection object, %s given.', __METHOD__, \gettype($connection))); throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a string or a connection object, "%s" given.', __METHOD__, \gettype($connection)));
} }
switch (true) { switch (true) {
@ -46,17 +46,17 @@ class SessionHandlerFactory
return new PdoSessionHandler($connection); return new PdoSessionHandler($connection);
case !\is_string($connection): case !\is_string($connection):
throw new \InvalidArgumentException(sprintf('Unsupported Connection: %s.', \get_class($connection))); throw new \InvalidArgumentException(sprintf('Unsupported Connection: "%s".', \get_class($connection)));
case 0 === strpos($connection, 'file://'): case 0 === strpos($connection, 'file://'):
return new StrictSessionHandler(new NativeFileSessionHandler(substr($connection, 7))); return new StrictSessionHandler(new NativeFileSessionHandler(substr($connection, 7)));
case 0 === strpos($connection, 'redis://'): case 0 === strpos($connection, 'redis:'):
case 0 === strpos($connection, 'rediss://'): case 0 === strpos($connection, 'rediss:'):
case 0 === strpos($connection, 'memcached://'): case 0 === strpos($connection, 'memcached:'):
if (!class_exists(AbstractAdapter::class)) { if (!class_exists(AbstractAdapter::class)) {
throw new InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require symfony/cache".', $connection)); throw new \InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require symfony/cache".', $connection));
} }
$handlerClass = 0 === strpos($connection, 'memcached://') ? MemcachedSessionHandler::class : RedisSessionHandler::class; $handlerClass = 0 === strpos($connection, 'memcached:') ? MemcachedSessionHandler::class : RedisSessionHandler::class;
$connection = AbstractAdapter::createConnection($connection, ['lazy' => true]); $connection = AbstractAdapter::createConnection($connection, ['lazy' => true]);
return new $handlerClass($connection); return new $handlerClass($connection);
@ -80,6 +80,6 @@ class SessionHandlerFactory
return new PdoSessionHandler($connection); return new PdoSessionHandler($connection);
} }
throw new \InvalidArgumentException(sprintf('Unsupported Connection: %s.', $connection)); throw new \InvalidArgumentException(sprintf('Unsupported Connection: "%s".', $connection));
} }
} }

View File

@ -148,7 +148,7 @@ class MockArraySessionStorage implements SessionStorageInterface
public function save() public function save()
{ {
if (!$this->started || $this->closed) { if (!$this->started || $this->closed) {
throw new \RuntimeException('Trying to save a session that was not started yet or was already closed'); throw new \RuntimeException('Trying to save a session that was not started yet or was already closed.');
} }
// nothing to do since we don't persist the session data // nothing to do since we don't persist the session data
$this->closed = false; $this->closed = false;
@ -186,7 +186,7 @@ class MockArraySessionStorage implements SessionStorageInterface
public function getBag(string $name) public function getBag(string $name)
{ {
if (!isset($this->bags[$name])) { if (!isset($this->bags[$name])) {
throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered.', $name)); throw new \InvalidArgumentException(sprintf('The SessionBagInterface "%s" is not registered.', $name));
} }
if (!$this->started) { if (!$this->started) {

View File

@ -36,7 +36,7 @@ class MockFileSessionStorage extends MockArraySessionStorage
} }
if (!is_dir($savePath) && !@mkdir($savePath, 0777, true) && !is_dir($savePath)) { if (!is_dir($savePath) && !@mkdir($savePath, 0777, true) && !is_dir($savePath)) {
throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s"', $savePath)); throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s".', $savePath));
} }
$this->savePath = $savePath; $this->savePath = $savePath;
@ -86,7 +86,7 @@ class MockFileSessionStorage extends MockArraySessionStorage
public function save() public function save()
{ {
if (!$this->started) { if (!$this->started) {
throw new \RuntimeException('Trying to save a session that was not started yet or was already closed'); throw new \RuntimeException('Trying to save a session that was not started yet or was already closed.');
} }
$data = $this->data; $data = $this->data;

View File

@ -17,6 +17,11 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandle
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy; use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
// Help opcache.preload discover always-needed symbols
class_exists(MetadataBag::class);
class_exists(StrictSessionHandler::class);
class_exists(SessionHandlerProxy::class);
/** /**
* This provides a base class for session attribute storage. * This provides a base class for session attribute storage.
* *
@ -139,7 +144,7 @@ class NativeSessionStorage implements SessionStorageInterface
return true; return true;
} }
if (\PHP_SESSION_ACTIVE === session_status()) { if (PHP_SESSION_ACTIVE === session_status()) {
throw new \RuntimeException('Failed to start the session: already started by PHP.'); throw new \RuntimeException('Failed to start the session: already started by PHP.');
} }
@ -149,7 +154,7 @@ class NativeSessionStorage implements SessionStorageInterface
// ok to try and start the session // ok to try and start the session
if (!session_start()) { if (!session_start()) {
throw new \RuntimeException('Failed to start the session'); throw new \RuntimeException('Failed to start the session.');
} }
if (null !== $this->emulateSameSite) { if (null !== $this->emulateSameSite) {
@ -202,7 +207,7 @@ class NativeSessionStorage implements SessionStorageInterface
public function regenerate(bool $destroy = false, int $lifetime = null) public function regenerate(bool $destroy = false, int $lifetime = null)
{ {
// Cannot regenerate the session ID for non-active sessions. // Cannot regenerate the session ID for non-active sessions.
if (\PHP_SESSION_ACTIVE !== session_status()) { if (PHP_SESSION_ACTIVE !== session_status()) {
return false; return false;
} }
@ -311,7 +316,7 @@ class NativeSessionStorage implements SessionStorageInterface
public function getBag(string $name) public function getBag(string $name)
{ {
if (!isset($this->bags[$name])) { if (!isset($this->bags[$name])) {
throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered.', $name)); throw new \InvalidArgumentException(sprintf('The SessionBagInterface "%s" is not registered.', $name));
} }
if (!$this->started && $this->saveHandler->isActive()) { if (!$this->started && $this->saveHandler->isActive()) {
@ -362,7 +367,7 @@ class NativeSessionStorage implements SessionStorageInterface
*/ */
public function setOptions(array $options) public function setOptions(array $options)
{ {
if (headers_sent() || \PHP_SESSION_ACTIVE === session_status()) { if (headers_sent() || PHP_SESSION_ACTIVE === session_status()) {
return; return;
} }
@ -401,13 +406,11 @@ class NativeSessionStorage implements SessionStorageInterface
* ini_set('session.save_path', '/tmp'); * ini_set('session.save_path', '/tmp');
* *
* or pass in a \SessionHandler instance which configures session.save_handler in the * or pass in a \SessionHandler instance which configures session.save_handler in the
* constructor, for a template see NativeFileSessionHandler or use handlers in * constructor, for a template see NativeFileSessionHandler.
* composer package drak/native-session
* *
* @see https://php.net/session-set-save-handler * @see https://php.net/session-set-save-handler
* @see https://php.net/sessionhandlerinterface * @see https://php.net/sessionhandlerinterface
* @see https://php.net/sessionhandler * @see https://php.net/sessionhandler
* @see https://github.com/zikula/NativeSession
* *
* @param AbstractProxy|\SessionHandlerInterface|null $saveHandler * @param AbstractProxy|\SessionHandlerInterface|null $saveHandler
* *
@ -429,7 +432,7 @@ class NativeSessionStorage implements SessionStorageInterface
} }
$this->saveHandler = $saveHandler; $this->saveHandler = $saveHandler;
if (headers_sent() || \PHP_SESSION_ACTIVE === session_status()) { if (headers_sent() || PHP_SESSION_ACTIVE === session_status()) {
return; return;
} }

View File

@ -65,7 +65,7 @@ abstract class AbstractProxy
*/ */
public function isActive() public function isActive()
{ {
return \PHP_SESSION_ACTIVE === session_status(); return PHP_SESSION_ACTIVE === session_status();
} }
/** /**
@ -86,7 +86,7 @@ abstract class AbstractProxy
public function setId(string $id) public function setId(string $id)
{ {
if ($this->isActive()) { if ($this->isActive()) {
throw new \LogicException('Cannot change the ID of an active session'); throw new \LogicException('Cannot change the ID of an active session.');
} }
session_id($id); session_id($id);
@ -110,7 +110,7 @@ abstract class AbstractProxy
public function setName(string $name) public function setName(string $name)
{ {
if ($this->isActive()) { if ($this->isActive()) {
throw new \LogicException('Cannot change the name of an active session'); throw new \LogicException('Cannot change the name of an active session.');
} }
session_name($name); session_name($name);

View File

@ -1,3 +0,0 @@
/Tests export-ignore
/phpunit.xml.dist export-ignore
/.gitignore export-ignore

View File

@ -24,7 +24,7 @@ abstract class SMime
protected function normalizeFilePath(string $path): string protected function normalizeFilePath(string $path): string
{ {
if (!file_exists($path)) { if (!file_exists($path)) {
throw new RuntimeException(sprintf('File does not exist: %s.', $path)); throw new RuntimeException(sprintf('File does not exist: "%s".', $path));
} }
return 'file://'.str_replace('\\', '/', realpath($path)); return 'file://'.str_replace('\\', '/', realpath($path));

View File

@ -20,9 +20,7 @@ use Symfony\Component\Mime\Exception\AddressEncoderException;
* SMTP servers. * SMTP servers.
* *
* This encoder does not support email addresses with non-ASCII characters in * This encoder does not support email addresses with non-ASCII characters in
* local-part (the substring before @). To send to such addresses, use * local-part (the substring before @).
* Utf8AddressEncoder together with SmtpUtf8Handler. Your outbound SMTP server must support
* the SMTPUTF8 extension.
* *
* @author Christian Schmidt * @author Christian Schmidt
*/ */

View File

@ -91,7 +91,7 @@ abstract class AbstractMultipartPart extends AbstractPart
private function getBoundary(): string private function getBoundary(): string
{ {
if (null === $this->boundary) { if (null === $this->boundary) {
$this->boundary = '_=_symfony_'.time().'_'.bin2hex(random_bytes(16)).'_=_'; $this->boundary = strtr(base64_encode(random_bytes(6)), '+/', '-_');
} }
return $this->boundary; return $this->boundary;

View File

@ -57,7 +57,7 @@ class DataPart extends TextPart
} }
if (false === $handle = @fopen($path, 'r', false)) { if (false === $handle = @fopen($path, 'r', false)) {
throw new InvalidArgumentException(sprintf('Unable to open path "%s"', $path)); throw new InvalidArgumentException(sprintf('Unable to open path "%s".', $path));
} }
$p = new self($handle, $name ?: basename($path), $contentType); $p = new self($handle, $name ?: basename($path), $contentType);
$p->handle = $handle; $p->handle = $handle;

View File

@ -28,7 +28,7 @@
"minimum-stability": "dev", "minimum-stability": "dev",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.14-dev" "dev-master": "1.15-dev"
} }
} }
} }

View File

@ -1,7 +1,7 @@
Symfony Polyfill / Intl: Idn Symfony Polyfill / Intl: Idn
============================ ============================
This component provides `idn_to_ascii` and `idn_to_utf8` functions to users who run php versions without the intl extension. This component provides [`idn_to_ascii`](https://php.net/idn-to-ascii) and [`idn_to_utf8`](https://php.net/idn-to-utf8) functions to users who run php versions without the [Intl](https://php.net/intl) extension.
More information can be found in the More information can be found in the
[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). [main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).

View File

@ -11,7 +11,7 @@
use Symfony\Polyfill\Intl\Idn as p; use Symfony\Polyfill\Intl\Idn as p;
if (!function_exists('idn_to_ascii')) { if (!defined('IDNA_DEFAULT')) {
define('U_IDNA_PROHIBITED_ERROR', 66560); define('U_IDNA_PROHIBITED_ERROR', 66560);
define('U_IDNA_ERROR_START', 66560); define('U_IDNA_ERROR_START', 66560);
define('U_IDNA_UNASSIGNED_ERROR', 66561); define('U_IDNA_UNASSIGNED_ERROR', 66561);
@ -48,7 +48,9 @@ if (!function_exists('idn_to_ascii')) {
define('IDNA_ERROR_INVALID_ACE_LABEL', 1024); define('IDNA_ERROR_INVALID_ACE_LABEL', 1024);
define('IDNA_ERROR_BIDI', 2048); define('IDNA_ERROR_BIDI', 2048);
define('IDNA_ERROR_CONTEXTJ', 4096); define('IDNA_ERROR_CONTEXTJ', 4096);
}
if (!function_exists('idn_to_ascii')) {
if (PHP_VERSION_ID < 70400) { if (PHP_VERSION_ID < 70400) {
function idn_to_ascii($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_2003, &$idna_info = array()) { return p\Idn::idn_to_ascii($domain, $options, $variant, $idna_info); } function idn_to_ascii($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_2003, &$idna_info = array()) { return p\Idn::idn_to_ascii($domain, $options, $variant, $idna_info); }
function idn_to_utf8($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_2003, &$idna_info = array()) { return p\Idn::idn_to_utf8($domain, $options, $variant, $idna_info); } function idn_to_utf8($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_2003, &$idna_info = array()) { return p\Idn::idn_to_utf8($domain, $options, $variant, $idna_info); }

View File

@ -30,7 +30,7 @@
"minimum-stability": "dev", "minimum-stability": "dev",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.14-dev" "dev-master": "1.15-dev"
} }
} }
} }

View File

@ -2,7 +2,7 @@ Symfony Polyfill / Mbstring
=========================== ===========================
This component provides a partial, native PHP implementation for the This component provides a partial, native PHP implementation for the
[Mbstring](http://php.net/mbstring) extension. [Mbstring](https://php.net/mbstring) extension.
More information can be found in the More information can be found in the
[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). [main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).

View File

@ -11,11 +11,13 @@
use Symfony\Polyfill\Mbstring as p; use Symfony\Polyfill\Mbstring as p;
if (!function_exists('mb_strlen')) { if (!defined('MB_CASE_UPPER')) {
define('MB_CASE_UPPER', 0); define('MB_CASE_UPPER', 0);
define('MB_CASE_LOWER', 1); define('MB_CASE_LOWER', 1);
define('MB_CASE_TITLE', 2); define('MB_CASE_TITLE', 2);
}
if (!function_exists('mb_strlen')) {
function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); } function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); }
function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); }
function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); }

View File

@ -28,7 +28,7 @@
"minimum-stability": "dev", "minimum-stability": "dev",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.14-dev" "dev-master": "1.15-dev"
} }
} }
} }

View File

@ -16,7 +16,7 @@ Moved to core since 7.2 (was in the optional XML extension earlier):
- [`utf8_decode`](https://php.net/utf8_decode) - [`utf8_decode`](https://php.net/utf8_decode)
Also, it provides a constant added to PHP 7.2: Also, it provides a constant added to PHP 7.2:
- [`PHP_OS_FAMILY`](http://php.net/manual/en/reserved.constants.php#constant.php-os-family) - [`PHP_OS_FAMILY`](https://php.net/reserved.constants#constant.php-os-family)
More information can be found in the More information can be found in the
[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). [main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).

View File

@ -25,7 +25,7 @@
"minimum-stability": "dev", "minimum-stability": "dev",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.14-dev" "dev-master": "1.15-dev"
} }
} }
} }