From 74002bbf57ebf3d61f32f591e50c777f3c7dfec5 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Thu, 27 Dec 2018 21:43:11 +0000 Subject: [PATCH] psalm fixes --- composer.lock | 1513 ++++++++++++++++++++++------- config.inc.php | 1 + functions.inc.php | 24 +- model/AdminHandler.php | 8 +- model/AdminpasswordHandler.php | 4 +- model/AliasHandler.php | 20 +- model/CliDelete.php | 2 + model/CliEdit.php | 3 +- model/CliView.php | 2 + model/Config.php | 72 +- model/DomainHandler.php | 34 +- model/FetchmailHandler.php | 3 - model/MailboxHandler.php | 24 +- model/PFAHandler.php | 28 +- model/Shell.php | 2 +- model/VacationHandler.php | 4 + public/backup.php | 2 +- public/broadcast-message.php | 4 +- public/index.php | 4 +- public/list-virtual.php | 7 + public/login.php | 2 +- public/upgrade.php | 124 +-- public/users/password-recover.php | 9 +- public/viewlog.php | 14 +- public/xmlrpc.php | 2 +- templates/header.php | 8 +- 26 files changed, 1391 insertions(+), 529 deletions(-) diff --git a/composer.lock b/composer.lock index 11f5b1bc..938be0ad 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "d81d48a0d7b315ede9f1b490c2fecce3", + "content-hash": "d0795fc3b7aaacdb6097e05ebbe7a03f", "packages": [], "packages-dev": [ { @@ -69,32 +69,76 @@ ], "time": "2016-08-30T16:08:34+00:00" }, + { + "name": "composer/xdebug-handler", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "dc523135366eb68f22268d069ea7749486458562" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/dc523135366eb68f22268d069ea7749486458562", + "reference": "dc523135366eb68f22268d069ea7749486458562", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "time": "2018-11-29T10:59:02+00:00" + }, { "name": "doctrine/annotations", - "version": "v1.4.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -135,36 +179,36 @@ "docblock", "parser" ], - "time": "2017-02-24T16:22:25+00:00" + "time": "2017-12-06T07:11:42+00:00" }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -189,7 +233,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2017-07-22T11:58:36+00:00" }, { "name": "doctrine/lexer", @@ -245,29 +289,117 @@ ], "time": "2014-09-09T13:34:57+00:00" }, + { + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.0.3", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "241c470695366e7b83672be04ea0e64d8085a551" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/241c470695366e7b83672be04ea0e64d8085a551", + "reference": "241c470695366e7b83672be04ea0e64d8085a551", + "shasum": "" + }, + "require": { + "netresearch/jsonmapper": "^1.0", + "php": ">=7.0", + "phpdocumentor/reflection-docblock": "^4.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "AdvancedJsonRpc\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "A more advanced JSONRPC implementation", + "time": "2018-09-10T08:58:41+00:00" + }, + { + "name": "felixfbecker/language-server-protocol", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "1bdd1bcc95428edf85ec04c7b558d0886c07280f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/1bdd1bcc95428edf85ec04c7b558d0886c07280f", + "reference": "1bdd1bcc95428edf85ec04c7b558d0886c07280f", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpstan/phpstan": "*", + "phpunit/phpunit": "^6.3", + "squizlabs/php_codesniffer": "^3.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "LanguageServerProtocol\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "PHP classes for the Language Server Protocol", + "keywords": [ + "language", + "microsoft", + "php", + "server" + ], + "time": "2018-09-25T11:42:25+00:00" + }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.10.2", + "version": "v2.13.1", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "74e4682a4073bc8bc2d4ff2b30a4873ac76cc1f1" + "reference": "54814c62d5beef3ba55297b9b3186ed8b8a1b161" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/74e4682a4073bc8bc2d4ff2b30a4873ac76cc1f1", - "reference": "74e4682a4073bc8bc2d4ff2b30a4873ac76cc1f1", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/54814c62d5beef3ba55297b9b3186ed8b8a1b161", + "reference": "54814c62d5beef3ba55297b9b3186ed8b8a1b161", "shasum": "" }, "require": { "composer/semver": "^1.4", + "composer/xdebug-handler": "^1.2", "doctrine/annotations": "^1.2", "ext-json": "*", "ext-tokenizer": "*", - "gecko-packages/gecko-php-unit": "^2.0 || ^3.0", "php": "^5.6 || >=7.0 <7.3", - "php-cs-fixer/diff": "^1.2", - "symfony/console": "^3.2 || ^4.0", + "php-cs-fixer/diff": "^1.3", + "symfony/console": "^3.4.17 || ^4.1.6", "symfony/event-dispatcher": "^3.0 || ^4.0", "symfony/filesystem": "^3.0 || ^4.0", "symfony/finder": "^3.0 || ^4.0", @@ -281,18 +413,22 @@ "hhvm": "*" }, "require-dev": { - "johnkary/phpunit-speedtrap": "^1.1 || ^2.0@dev", + "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.0", + "keradus/cli-executor": "^1.1", "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.0", + "php-coveralls/php-coveralls": "^2.1", "php-cs-fixer/accessible-object": "^1.0", - "phpunit/phpunit": "^5.7.23 || ^6.4.3", - "phpunitgoodpractices/traits": "^1.0", - "symfony/phpunit-bridge": "^3.2.2 || ^4.0" + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.0.1", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.0.1", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1", + "phpunitgoodpractices/traits": "^1.5.1", + "symfony/phpunit-bridge": "^4.0" }, "suggest": { "ext-mbstring": "For handling non-UTF8 characters in cache signature.", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." }, "bin": [ @@ -330,125 +466,136 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2018-02-03T08:30:06+00:00" + "time": "2018-10-21T00:32:10+00:00" }, { - "name": "gecko-packages/gecko-php-unit", - "version": "v3.0", + "name": "jakub-onderka/php-parallel-lint", + "version": "v1.0.0", "source": { "type": "git", - "url": "https://github.com/GeckoPackages/GeckoPHPUnit.git", - "reference": "6a866551dffc2154c1b091bae3a7877d39c25ca3" + "url": "https://github.com/JakubOnderka/PHP-Parallel-Lint.git", + "reference": "04fbd3f5fb1c83f08724aa58a23db90bd9086ee8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GeckoPackages/GeckoPHPUnit/zipball/6a866551dffc2154c1b091bae3a7877d39c25ca3", - "reference": "6a866551dffc2154c1b091bae3a7877d39c25ca3", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Parallel-Lint/zipball/04fbd3f5fb1c83f08724aa58a23db90bd9086ee8", + "reference": "04fbd3f5fb1c83f08724aa58a23db90bd9086ee8", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "jakub-onderka/php-console-highlighter": "~0.3", + "nette/tester": "~1.3", + "squizlabs/php_codesniffer": "~2.7" }, "suggest": { - "ext-dom": "When testing with xml.", - "ext-libxml": "When testing with xml.", - "phpunit/phpunit": "This is an extension for it so make sure you have it some way." + "jakub-onderka/php-console-highlighter": "Highlight syntax in code snippet" }, + "bin": [ + "parallel-lint" + ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, "autoload": { - "psr-4": { - "GeckoPackages\\PHPUnit\\": "src/PHPUnit" - } + "classmap": [ + "./" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-2-Clause" ], - "description": "Additional PHPUnit asserts and constraints.", - "homepage": "https://github.com/GeckoPackages", - "keywords": [ - "extension", - "filesystem", - "phpunit" + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } ], - "time": "2017-08-23T07:46:41+00:00" + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint", + "time": "2018-02-24T15:31:20+00:00" }, { - "name": "jakub-onderka/php-parallel-lint", - "version": "v0.9.2", + "name": "muglug/package-versions-56", + "version": "1.2.4", "source": { "type": "git", - "url": "https://github.com/JakubOnderka/PHP-Parallel-Lint.git", - "reference": "2ead2e4043ab125bee9554f356e0a86742c2d4fa" + "url": "https://github.com/muglug/PackageVersions.git", + "reference": "a67bed26deaaf9269a348e53063bc8d4dcc60ffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Parallel-Lint/zipball/2ead2e4043ab125bee9554f356e0a86742c2d4fa", - "reference": "2ead2e4043ab125bee9554f356e0a86742c2d4fa", + "url": "https://api.github.com/repos/muglug/PackageVersions/zipball/a67bed26deaaf9269a348e53063bc8d4dcc60ffd", + "reference": "a67bed26deaaf9269a348e53063bc8d4dcc60ffd", "shasum": "" }, "require": { - "php": ">=5.3.3" + "composer-plugin-api": "^1.0", + "php": "^5.6 || ^7.0" }, "require-dev": { - "jakub-onderka/php-console-highlighter": "~0.3", - "nette/tester": "~1.3" + "composer/composer": "^1.3", + "ext-zip": "*", + "phpunit/phpunit": "^5.7.5" }, - "suggest": { - "jakub-onderka/php-console-highlighter": "Highlight syntax in code snippet" + "type": "composer-plugin", + "extra": { + "class": "Muglug\\PackageVersions\\Installer", + "branch-alias": { + "dev-master": "2.0.x-dev" + } }, - "bin": [ - "parallel-lint" - ], - "type": "library", "autoload": { - "classmap": [ - "./" - ] + "psr-4": { + "Muglug\\PackageVersions\\": "src/PackageVersions" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "MIT" ], "authors": [ { - "name": "Jakub Onderka", - "email": "jakub.onderka@gmail.com" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Abdul Malik Ikhsan", + "email": "samsonasik@gmail.com" + }, + { + "name": "Matt Brown", + "email": "github@muglug.com" } ], - "description": "This tool check syntax of PHP files about 20x faster than serial check.", - "homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint", - "time": "2015-12-15T10:42:16+00:00" + "description": "A backport of ocramius/package-versions that supports php ^5.6. Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2018-03-26T03:22:13+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -471,37 +618,175 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2018-06-11T23:09:50+00:00" + }, + { + "name": "netresearch/jsonmapper", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "3868fe1128ce1169228acdb623359dca74db5ef3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/3868fe1128ce1169228acdb623359dca74db5ef3", + "reference": "3868fe1128ce1169228acdb623359dca74db5ef3", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4", + "squizlabs/php_codesniffer": "~1.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonMapper": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "OSL-3.0" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" + } + ], + "description": "Map nested JSON structures onto PHP classes", + "time": "2017-11-28T21:30:01+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.1.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "8aae5b59b83bb4d0dbf07b0a835f2680a658f610" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8aae5b59b83bb4d0dbf07b0a835f2680a658f610", + "reference": "8aae5b59b83bb4d0dbf07b0a835f2680a658f610", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5 || ^7.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2018-12-26T11:32:39+00:00" + }, + { + "name": "openlss/lib-array2xml", + "version": "0.5.1", + "source": { + "type": "git", + "url": "https://github.com/nullivex/lib-array2xml.git", + "reference": "c8b5998a342d7861f2e921403f44e0a2f3ef2be0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/c8b5998a342d7861f2e921403f44e0a2f3ef2be0", + "reference": "c8b5998a342d7861f2e921403f44e0a2f3ef2be0", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "LSS": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Bryan Tong", + "email": "contact@nullivex.com", + "homepage": "http://bryantong.com" + }, + { + "name": "Tony Butler", + "email": "spudz76@gmail.com", + "homepage": "http://openlss.org" + } + ], + "description": "Array2XML conversion library credit to lalit.org", + "homepage": "http://openlss.org", + "keywords": [ + "array", + "array conversion", + "xml", + "xml conversion" + ], + "time": "2016-11-10T19:10:18+00:00" }, { "name": "paragonie/random_compat", - "version": "v2.0.11", + "version": "v9.99.99", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8" + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8", - "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", "shasum": "" }, "require": { - "php": ">=5.2.0" + "php": "^7" }, "require-dev": { - "phpunit/phpunit": "4.*|5.*" + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" }, "suggest": { "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." }, "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -516,10 +801,113 @@ "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", "keywords": [ "csprng", + "polyfill", "pseudorandom", "random" ], - "time": "2017-09-27T21:40:39+00:00" + "time": "2018-07-02T15:55:56+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" }, { "name": "php-cs-fixer/diff", @@ -726,33 +1114,33 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.4", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "9f901e29c93dae4aa77c0bb161df4276f9c9a1be" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/9f901e29c93dae4aa77c0bb161df4276f9c9a1be", - "reference": "9f901e29c93dae4aa77c0bb161df4276f9c9a1be", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -785,44 +1173,44 @@ "spy", "stub" ], - "time": "2018-02-11T18:49:29+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "version": "5.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-xdebug": "^2.5.1" + "ext-xdebug": "^2.5.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.3.x-dev" } }, "autoload": { @@ -837,7 +1225,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -848,7 +1236,7 @@ "testing", "xunit" ], - "time": "2017-04-02T07:44:40+00:00" + "time": "2018-04-06T15:36:58+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1038,16 +1426,16 @@ }, { "name": "phpunit/phpunit", - "version": "5.7.27", + "version": "6.5.13", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + "reference": "0973426fb012359b2f18d3bd1e90ef1172839693" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0973426fb012359b2f18d3bd1e90ef1172839693", + "reference": "0973426fb012359b2f18d3bd1e90ef1172839693", "shasum": "" }, "require": { @@ -1056,33 +1444,35 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" + "phpunit/php-invoker": "^1.1" }, "bin": [ "phpunit" @@ -1090,7 +1480,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.7.x-dev" + "dev-master": "6.5.x-dev" } }, "autoload": { @@ -1116,33 +1506,33 @@ "testing", "xunit" ], - "time": "2018-02-01T05:50:59+00:00" + "time": "2018-09-08T15:10:43+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "version": "5.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" }, "conflict": { - "phpunit/phpunit": "<5.4.0" + "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^5.4" + "phpunit/phpunit": "^6.5.11" }, "suggest": { "ext-soap": "*" @@ -1150,7 +1540,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "5.0.x-dev" } }, "autoload": { @@ -1165,7 +1555,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1175,20 +1565,20 @@ "mock", "xunit" ], - "time": "2017-06-30T09:13:00+00:00" + "time": "2018-08-09T05:50:03+00:00" }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -1202,27 +1592,138 @@ }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "sabre/event", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/event.git", + "reference": "f5cf802d240df1257866d8813282b98aee3bc548" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/event/zipball/f5cf802d240df1257866d8813282b98aee3bc548", + "reference": "f5cf802d240df1257866d8813282b98aee3bc548", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": ">=6", + "sabre/cs": "~1.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Sabre\\Event\\": "lib/" + }, + "files": [ + "lib/coroutine.php", + "lib/Loop/functions.php", + "lib/Promise/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + } + ], + "description": "sabre/event is a library for lightweight event-based programming", + "homepage": "http://sabre.io/event/", + "keywords": [ + "EventEmitter", + "async", + "coroutine", + "eventloop", + "events", + "hooks", + "plugin", + "promise", + "reactor", + "signal" + ], + "time": "2018-03-05T13:55:47+00:00" + }, + { + "name": "sabre/uri", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/uri.git", + "reference": "a42126042c7dcb53e2978dadb6d22574d1359b4c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/uri/zipball/a42126042c7dcb53e2978dadb6d22574d1359b4c", + "reference": "a42126042c7dcb53e2978dadb6d22574d1359b4c", + "shasum": "" + }, + "require": { + "php": ">=7" + }, + "require-dev": { + "phpunit/phpunit": "^6.0", + "sabre/cs": "~1.0.0" + }, + "type": "library", + "autoload": { + "files": [ + "lib/functions.php" + ], + "psr-4": { + "Sabre\\Uri\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Functions for making sense out of URIs.", + "homepage": "http://sabre.io/uri/", "keywords": [ - "log", - "psr", - "psr-3" + "rfc3986", + "uri", + "url" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2017-02-20T20:02:35+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1271,30 +1772,30 @@ }, { "name": "sebastian/comparator", - "version": "1.2.4", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -1325,38 +1826,38 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2018-02-01T13:46:46+00:00" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1383,32 +1884,32 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", - "version": "2.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -1433,34 +1934,34 @@ "environment", "hhvm" ], - "time": "2016-11-26T07:53:53+00:00" + "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", - "version": "2.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -1500,27 +2001,27 @@ "export", "exporter" ], - "time": "2016-11-19T08:54:04+00:00" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -1528,7 +2029,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1551,33 +2052,34 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2017-04-27T15:39:26+00:00" }, { "name": "sebastian/object-enumerator", - "version": "2.0.1", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1597,32 +2099,77 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" }, { "name": "sebastian/recursion-context", - "version": "2.0.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1650,7 +2197,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" + "time": "2017-03-03T06:23:57+00:00" }, { "name": "sebastian/resource-operations", @@ -1739,21 +2286,21 @@ }, { "name": "symfony/console", - "version": "v3.4.4", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "26b6f419edda16c19775211987651cb27baea7f1" + "reference": "4dff24e5d01e713818805c1862d2e3f901ee7dd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/26b6f419edda16c19775211987651cb27baea7f1", - "reference": "26b6f419edda16c19775211987651cb27baea7f1", + "url": "https://api.github.com/repos/symfony/console/zipball/4dff24e5d01e713818805c1862d2e3f901ee7dd0", + "reference": "4dff24e5d01e713818805c1862d2e3f901ee7dd0", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", + "php": "^7.1.3", + "symfony/contracts": "^1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -1762,14 +2309,14 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", + "symfony/config": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/process": "~3.4|~4.0" }, "suggest": { - "psr/log": "For using the console logger", + "psr/log-implementation": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -1777,7 +2324,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -1804,44 +2351,48 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-01-29T09:03:43+00:00" + "time": "2018-11-27T07:40:44+00:00" }, { - "name": "symfony/debug", - "version": "v3.4.4", + "name": "symfony/contracts", + "version": "v1.0.2", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "53f6af2805daf52a43b393b93d2f24925d35c937" + "url": "https://github.com/symfony/contracts.git", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/53f6af2805daf52a43b393b93d2f24925d35c937", - "reference": "53f6af2805daf52a43b393b93d2f24925d35c937", + "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + "php": "^7.1.3" }, "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" + "psr/cache": "^1.0", + "psr/container": "^1.0" + }, + "suggest": { + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "1.0-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Debug\\": "" + "Symfony\\Contracts\\": "" }, "exclude-from-classmap": [ - "/Tests/" + "**/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1850,44 +2401,53 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Debug Component", + "description": "A set of abstractions extracted out of the Symfony components", "homepage": "https://symfony.com", - "time": "2018-01-18T22:16:57+00:00" + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2018-12-05T08:06:11+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.4", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "26b87b6bca8f8f797331a30b76fdae5342dc26ca" + "reference": "921f49c3158a276d27c0d770a5a347a3b718b328" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/26b87b6bca8f8f797331a30b76fdae5342dc26ca", - "reference": "26b87b6bca8f8f797331a30b76fdae5342dc26ca", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/921f49c3158a276d27c0d770a5a347a3b718b328", + "reference": "921f49c3158a276d27c0d770a5a347a3b718b328", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3", + "symfony/contracts": "^1.0" }, "conflict": { - "symfony/dependency-injection": "<3.3" + "symfony/dependency-injection": "<3.4" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/stopwatch": "~2.8|~3.0|~4.0" + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0" }, "suggest": { "symfony/dependency-injection": "", @@ -1896,7 +2456,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -1923,29 +2483,30 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:37:34+00:00" + "time": "2018-12-01T08:52:38+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.4", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "e078773ad6354af38169faf31c21df0f18ace03d" + "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e078773ad6354af38169faf31c21df0f18ace03d", - "reference": "e078773ad6354af38169faf31c21df0f18ace03d", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/2f4c8b999b3b7cadb2a69390b01af70886753710", + "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -1972,29 +2533,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:37:34+00:00" + "time": "2018-11-11T19:52:12+00:00" }, { "name": "symfony/finder", - "version": "v3.4.4", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "613e26310776f49a1773b6737c6bd554b8bc8c6f" + "reference": "e53d477d7b5c4982d0e1bfd2298dbee63d01441d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/613e26310776f49a1773b6737c6bd554b8bc8c6f", - "reference": "613e26310776f49a1773b6737c6bd554b8bc8c6f", + "url": "https://api.github.com/repos/symfony/finder/zipball/e53d477d7b5c4982d0e1bfd2298dbee63d01441d", + "reference": "e53d477d7b5c4982d0e1bfd2298dbee63d01441d", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2021,29 +2582,29 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:37:34+00:00" + "time": "2018-11-11T19:52:12+00:00" }, { "name": "symfony/options-resolver", - "version": "v3.4.4", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "f3109a6aedd20e35c3a33190e932c2b063b7b50e" + "reference": "a9c38e8a3da2c03b3e71fdffa6efb0bda51390ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/f3109a6aedd20e35c3a33190e932c2b063b7b50e", - "reference": "f3109a6aedd20e35c3a33190e932c2b063b7b50e", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a9c38e8a3da2c03b3e71fdffa6efb0bda51390ba", + "reference": "a9c38e8a3da2c03b3e71fdffa6efb0bda51390ba", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2075,20 +2636,78 @@ "configuration", "options" ], - "time": "2018-01-11T07:56:07+00:00" + "time": "2018-11-11T19:52:12+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -2100,7 +2719,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2134,30 +2753,30 @@ "portable", "shim" ], - "time": "2018-01-30T19:27:44+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.7.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f" + "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/3532bfcd8f933a7816f3a0a59682fc404776600f", - "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/6b88000cdd431cd2e940caa2cb569201f3f84224", + "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224", "shasum": "" }, "require": { - "paragonie/random_compat": "~1.0|~2.0", + "paragonie/random_compat": "~1.0|~2.0|~9.99", "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2193,20 +2812,20 @@ "portable", "shim" ], - "time": "2018-01-30T19:27:44+00:00" + "time": "2018-09-21T06:26:08+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.7.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "8eca20c8a369e069d4f4c2ac9895144112867422" + "reference": "9050816e2ca34a8e916c3a0ae8b9c2fccf68b631" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/8eca20c8a369e069d4f4c2ac9895144112867422", - "reference": "8eca20c8a369e069d4f4c2ac9895144112867422", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9050816e2ca34a8e916c3a0ae8b9c2fccf68b631", + "reference": "9050816e2ca34a8e916c3a0ae8b9c2fccf68b631", "shasum": "" }, "require": { @@ -2215,7 +2834,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2248,29 +2867,29 @@ "portable", "shim" ], - "time": "2018-01-31T17:43:24+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/process", - "version": "v3.4.4", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "09a5172057be8fc677840e591b17f385e58c7c0d" + "reference": "2b341009ccec76837a7f46f59641b431e4d4c2b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/09a5172057be8fc677840e591b17f385e58c7c0d", - "reference": "09a5172057be8fc677840e591b17f385e58c7c0d", + "url": "https://api.github.com/repos/symfony/process/zipball/2b341009ccec76837a7f46f59641b431e4d4c2b0", + "reference": "2b341009ccec76837a7f46f59641b431e4d4c2b0", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2297,29 +2916,30 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-01-29T09:03:43+00:00" + "time": "2018-11-20T16:22:05+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.4.4", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "c865551df7c17e63fc1f09f763db04387f91ae4d" + "reference": "ec076716412274e51f8a7ea675d9515e5c311123" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/c865551df7c17e63fc1f09f763db04387f91ae4d", - "reference": "c865551df7c17e63fc1f09f763db04387f91ae4d", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/ec076716412274e51f8a7ea675d9515e5c311123", + "reference": "ec076716412274e51f8a7ea675d9515e5c311123", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3", + "symfony/contracts": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2346,47 +2966,108 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:37:34+00:00" + "time": "2018-11-11T19:52:12+00:00" }, { - "name": "symfony/yaml", - "version": "v3.4.4", + "name": "theseer/tokenizer", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "eab73b6c21d27ae4cd037c417618dfd4befb0bfe" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/eab73b6c21d27ae4cd037c417618dfd4befb0bfe", - "reference": "eab73b6c21d27ae4cd037c417618dfd4befb0bfe", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" }, - "conflict": { - "symfony/console": "<3.4" + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "vimeo/psalm", + "version": "3.0.7", + "source": { + "type": "git", + "url": "https://github.com/vimeo/psalm.git", + "reference": "10a36def968a4e642b1afec74e3f0be602c79f58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/10a36def968a4e642b1afec74e3f0be602c79f58", + "reference": "10a36def968a4e642b1afec74e3f0be602c79f58", + "shasum": "" + }, + "require": { + "composer/xdebug-handler": "^1.1", + "felixfbecker/advanced-json-rpc": "^3.0.3", + "felixfbecker/language-server-protocol": "^1.2", + "muglug/package-versions-56": "1.2.4", + "netresearch/jsonmapper": "^1.0", + "nikic/php-parser": "^4.0.2 || ^4.1", + "openlss/lib-array2xml": "^0.0.10||^0.5.1", + "php": "^7.0", + "php-cs-fixer/diff": "^1.2", + "sabre/event": "^5.0.1", + "sabre/uri": "^2.0", + "symfony/console": "^3.0||^4.0", + "webmozart/glob": "^4.1", + "webmozart/path-util": "^2.3" + }, + "provide": { + "psalm/psalm": "self.version" }, "require-dev": { - "symfony/console": "~3.4|~4.0" + "bamarni/composer-bin-plugin": "^1.2", + "phpunit/phpunit": "^6.0 || ^7.0", + "squizlabs/php_codesniffer": "^3.0" }, "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "ext-igbinary": "^2.0.5" }, + "bin": [ + "psalm", + "psalter", + "psalm-language-server", + "psalm-plugin" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Psalm\\Plugin\\": "src/Psalm/Plugin", + "Psalm\\": "src/Psalm" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2394,34 +3075,34 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Matthew Brown" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2018-01-21T19:05:02+00:00" + "description": "A static analysis tool for finding errors in PHP applications", + "keywords": [ + "code", + "inspection", + "php" + ], + "time": "2018-12-21T18:53:22+00:00" }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -2454,7 +3135,100 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" + "time": "2018-12-25T11:19:39+00:00" + }, + { + "name": "webmozart/glob", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/glob.git", + "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/glob/zipball/3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", + "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0", + "webmozart/path-util": "^2.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1", + "symfony/filesystem": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Glob\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A PHP implementation of Ant's glob.", + "time": "2015-12-29T11:14:33+00:00" + }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "time": "2015-12-17T08:42:14+00:00" }, { "name": "zendframework/zendframework1", @@ -2501,6 +3275,7 @@ "ZF1", "framework" ], + "abandoned": "zendframework/zendframework", "time": "2016-09-08T14:50:34+00:00" } ], diff --git a/config.inc.php b/config.inc.php index 744b9ae7..39362f80 100644 --- a/config.inc.php +++ b/config.inc.php @@ -31,6 +31,7 @@ ################################################################################ +global $CONF; /***************************************************************** * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/functions.inc.php b/functions.inc.php index 09e8aa49..7769da96 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -319,11 +319,12 @@ function check_email($email) { * Clean a string, escaping any meta characters that could be * used to disrupt an SQL string. i.e. "'" => "\'" etc. * - * @param string|array $string parameters to escape - * @return string|array of cleaned data, suitable for use within an SQL statement. + * @param string $string parameters to escape + * @return string cleaned data, suitable for use within an SQL statement. */ function escape_string($string) { global $CONF; + // if the string is actually an array, do a recursive cleaning. // Note, the array keys are not cleaned. if (is_array($string)) { @@ -846,13 +847,13 @@ function encode_header($string, $default_charset = "utf-8") { return $string; } - +/* if (!function_exists('random_int')) { // PHP version < 7.0 function random_int() { // someone might not be using php_crypt or ask for password generation, in which case random_int() won't be called die(__FILE__ . " Postfixadmin security: Please install https://github.com/paragonie/random_compat OR enable the 'Phar' extension."); } } - + */ /** * Generate a random password of $length characters. @@ -1315,19 +1316,6 @@ function create_salt() { return $salt; } -/**/ if (!function_exists('hex2bin')) { # PHP around 5.3.8 includes hex2bin as native function - http://php.net/hex2bin - function hex2bin($str) { - $len = strlen($str); - $nstr = ""; - for ($i=0;$i<$len;$i+=2) { - $num = sscanf(substr($str, $i, 2), "%x"); - $nstr.=chr($num[0]); - } - return $nstr; - } - /**/ -} - /* * remove item $item from array $array */ @@ -1829,7 +1817,7 @@ function db_array($result) { */ function db_assoc($result) { global $CONF; - $row = ""; + $row = []; if ($CONF['database_type'] == "mysql") { /* @var resource $result */ $row = mysql_fetch_assoc($result); diff --git a/model/AdminHandler.php b/model/AdminHandler.php index 1d2f3cf3..0c97defc 100644 --- a/model/AdminHandler.php +++ b/model/AdminHandler.php @@ -34,7 +34,7 @@ class AdminHandler extends PFAHandler { $domains_grouped = 'group_concat(domain)'; } - $passwordReset = Config::read('forgotten_admin_password_reset'); + $passwordReset = (int) Config::bool('forgotten_admin_password_reset'); $reset_by_sms = 0; if ($passwordReset && Config::read('sms_send_function')) { @@ -44,10 +44,10 @@ class AdminHandler extends PFAHandler { $this->struct=array( # field name allow display in... type $PALANG label $PALANG description default / options / ... # editing? form list - 'username' => pacol($this->new, 1, 1, 'text', 'admin' , 'email_address' , '', '', + 'username' => pacol($this->new, 1, 1, 'text', 'admin' , 'email_address' , '', array(), array('linkto' => 'list.php?table=domain&username=%s') ), 'password' => pacol(1, 1, 0, 'pass', 'password' , '' ), - 'password2' => pacol(1, 1, 0, 'pass', 'password_again' , '' , '', '', + 'password2' => pacol(1, 1, 0, 'pass', 'password_again' , '' , '', array(), /*not_in_db*/ 0, /*dont_write_to_db*/ 1, /*select*/ 'password as password2' @@ -69,7 +69,7 @@ class AdminHandler extends PFAHandler { /*extrafrom set in domain_count*/ ), - 'domain_count' => pacol(0, 0, 1, 'vnum', 'pAdminList_admin_count', '' , '', '', + 'domain_count' => pacol(0, 0, 1, 'vnum', 'pAdminList_admin_count', '' , '', array(), /*not_in_db*/ 0, /*dont_write_to_db*/ 1, /*select*/ 'coalesce(__domain_count,0) as domain_count', diff --git a/model/AdminpasswordHandler.php b/model/AdminpasswordHandler.php index fe16a528..d8add63a 100644 --- a/model/AdminpasswordHandler.php +++ b/model/AdminpasswordHandler.php @@ -24,10 +24,10 @@ class AdminpasswordHandler extends PFAHandler { # field name allow display in... type $PALANG label $PALANG description default / options / ... # editing? form list 'username' => pacol(0, 1, 1, 'text', 'admin' , '' ), - 'oldpass' => pacol(1, 1, 0, 'pass', 'pPassword_password_current' , '', '', '', + 'oldpass' => pacol(1, 1, 0, 'pass', 'pPassword_password_current' , '', '', array(), /*not_in_db*/ 1 ), 'password' => pacol(1, 1, 0, 'pass', 'pPassword_password' , '' ), - 'password2' => pacol(1, 1, 0, 'pass', 'pPassword_password2' , '' , '', '', + 'password2' => pacol(1, 1, 0, 'pass', 'pPassword_password2' , '' , '', array(), /*not_in_db*/ 0, /*dont_write_to_db*/ 1, /*select*/ 'password as password2' diff --git a/model/AliasHandler.php b/model/AliasHandler.php index 6e168d58..af9af937 100644 --- a/model/AliasHandler.php +++ b/model/AliasHandler.php @@ -26,11 +26,11 @@ class AliasHandler extends PFAHandler { $this->struct=array( # field name allow display in... type $PALANG label $PALANG description default / ... # editing? form list - 'status' => pacol(0, 0, 0, 'html', '' , '' , '', '', + 'status' => pacol(0, 0, 0, 'html', '' , '' , '', array(), array('not_in_db' => 1) ), 'address' => pacol($this->new, 1, 1, 'mail', 'alias' , 'pCreate_alias_catchall_text' ), 'localpart' => pacol($this->new, 0, 0, 'text', 'alias' , 'pCreate_alias_catchall_text' , '', - /*options*/ '', + /*options*/ array(), /*not_in_db*/ 1 ), 'domain' => pacol($this->new, 0, 1, 'enum', '' , '' , '', /*options*/ $this->allowed_domains ), @@ -38,24 +38,24 @@ class AliasHandler extends PFAHandler { 'is_mailbox' => pacol(0, 0, 1, 'int', '' , '' , 0 , # technically 'is_mailbox' is bool, but the automatic bool conversion breaks the query. Flagging it as int avoids this problem. # Maybe having a vbool type (without the automatic conversion) would be cleaner - we'll see if we need it. - /*options*/ '', + /*options*/ array(), /*not_in_db*/ 0, /*dont_write_to_db*/ 1, /*select*/ 'coalesce(__is_mailbox,0) as is_mailbox' ), /*extrafrom set via set_is_mailbox_extrafrom() */ '__mailbox_username' => pacol( 0, 0, 1, 'vtxt', '' , '' , 0), # filled via is_mailbox 'goto_mailbox' => pacol($mbgoto, $mbgoto,$mbgoto,'bool', 'pEdit_alias_forward_and_store' , '' , 0, - /*options*/ '', + /*options*/ array(), /*not_in_db*/ 1 ), # read_from_db_postprocess() sets the value 'on_vacation' => pacol(1, 0, 1, 'bool', 'pUsersMenu_vacation' , '' , 0 , - /*options*/ '', + /*options*/ array(), /*not_in_db*/ 1 ), # read_from_db_postprocess() sets the value - TODO: read active flag from vacation table instead? 'created' => pacol(0, 0, 0, 'ts', 'created' , '' ), 'modified' => pacol(0, 0, 1, 'ts', 'last_modified' , '' ), 'active' => pacol(1, 1, 1, 'bool', 'active' , '' , 1 ), - '_can_edit' => pacol(0, 0, 1, 'vnum', '' , '' , 0 , '', + '_can_edit' => pacol(0, 0, 1, 'vnum', '' , '' , 0 , array(), array('select' => '1 as _can_edit') ), - '_can_delete' => pacol(0, 0, 1, 'vnum', '' , '' , 0 , '', + '_can_delete' => pacol(0, 0, 1, 'vnum', '' , '' , 0 , array(), array('select' => '1 as _can_delete') ), # read_from_db_postprocess() updates the value # aliases listed in $CONF[default_aliases] are read-only for domain admins if $CONF[special_alias_control] is NO. ); @@ -326,12 +326,12 @@ class AliasHandler extends PFAHandler { # editing a default alias (postmaster@ etc.) is only allowed if special_alias_control is allowed or if the user is a superadmin $tmp = preg_split('/\@/', $db_result[$key]['address']); - if (!$this->is_superadmin && !Config::bool('special_alias_control') && array_key_exists($tmp[0], Config::Read('default_aliases'))) { + if (!$this->is_superadmin && !Config::bool('special_alias_control') && array_key_exists($tmp[0], Config::read_array('default_aliases'))) { $db_result[$key]['_can_edit'] = 0; $db_result[$key]['_can_delete'] = 0; } - if ($this->struct['status']['display_in_list'] && Config::Bool('show_status')) { + if ($this->struct['status']['display_in_list'] && Config::bool('show_status')) { $db_result[$key]['status'] = gen_show_status($db_result[$key]['address']); } } @@ -440,7 +440,7 @@ class AliasHandler extends PFAHandler { */ protected function getVacationAlias() { $vacation_goto = str_replace('@', '#', $this->id); - return $vacation_goto . '@' . Config::read('vacation_domain'); + return $vacation_goto . '@' . Config::read_string('vacation_domain'); } /** diff --git a/model/CliDelete.php b/model/CliDelete.php index c3391d93..c6a0a6ea 100644 --- a/model/CliDelete.php +++ b/model/CliDelete.php @@ -6,6 +6,8 @@ class CliDelete extends Shell { + protected $handler_to_use = ''; + /** * Execution method always used for tasks */ diff --git a/model/CliEdit.php b/model/CliEdit.php index def5a13a..b662dda3 100644 --- a/model/CliEdit.php +++ b/model/CliEdit.php @@ -77,7 +77,8 @@ class CliEdit extends Shell { $form_fields = $handler->getStruct(); $id_field = $handler->getId_field(); - $values[$id_field] = ''; + + $values = array($id_field => ''); while ($form_fields[$id_field]['editable'] != 0) { # endlees loop - except if input is valid or id_field is not editable (like auto_increment) $question = $form_fields[$id_field]['label'] . ":"; if ($form_fields[$id_field]['desc'] != '') { diff --git a/model/CliView.php b/model/CliView.php index bd9bdbf3..8f100112 100644 --- a/model/CliView.php +++ b/model/CliView.php @@ -6,6 +6,8 @@ class CliView extends Shell { + protected $handler_to_use = 'invalid'; + /** * Execution method always used for tasks */ diff --git a/model/Config.php b/model/Config.php index 144b3103..6badb63d 100644 --- a/model/Config.php +++ b/model/Config.php @@ -68,6 +68,39 @@ final class Config { $_this->setAll($newConfig); } + /** + * @return array + * @param string $var + */ + public static function read_array($var) { + $stuff = self::read($var); + + if(!is_array($stuff)) { + trigger_error('In '.__FUNCTION__.": expected config $var to be a boolean, but received a " . gettype($stuff), E_USER_ERROR); + } + + return $stuff; + } + + /** + * @param string $var + * @return string + */ + public static function read_string($var) { + $stuff = self::read($var); + + if($stuff === null) { + return ''; + } + + if(!is_string($stuff)) { + trigger_error('In '.__FUNCTION__.": expected config $var to be a string, but received a " . gettype($stuff), E_USER_ERROR); + return ''; + } + + return $stuff; + } + /** * Used to read Configure::$var * @@ -76,7 +109,7 @@ final class Config { * Configure::read('Name.key'); will return only the value of Configure::Name[key] * * @param string $var Variable to obtain - * @return array|string string value of Configure::$var + * @return array|string|null string value of Configure::$var * @access public */ public static function read($var) { @@ -131,7 +164,7 @@ final class Config { * @access public */ public static function read_f($var, $value) { - $text = self::read($var); + $text = self::read_string($var); $newtext = sprintf($text, $value); @@ -148,19 +181,28 @@ final class Config { /** * Used to read Config::$var, converted to boolean - * (obviously only useful for settings that can be YES or NO) + * (obviously only useful for settings that can be YES or NO, or boolean like values) * * Usage * Configure::read('Name'); will return the value for Name, converted to boolean * * @param string $var Variable to obtain * @return bool value of Configure::$var (TRUE (on YES/yes) or FALSE (on NO/no/not set/unknown value) - * @access public */ public static function bool($var) { $value = self::read($var); + if(is_bool($value)) { + return $value; + } + + if(!is_string($value)) { + trigger_error('In '.__FUNCTION__.": expected config $var to be a string, but received a " . gettype($value), E_USER_ERROR); + error_log("config $var should be a string, found: " . json_encode($value)); + return false; + } + if (strtoupper($value) == 'YES') { # YES return true; } elseif (strtoupper($value) == 'NO') { # NO @@ -185,15 +227,19 @@ final class Config { /** - * Get translated text from $PALANG - * (wrapper for self::read(), see also the comments there) - * - * @param string $var Variable to obtain - * @return string value of $PALANG[$var] - * @access public - */ + * Get translated text from $PALANG + * (wrapper for self::read(), see also the comments there) + * + * @param string $var Variable to obtain + * @return string value of $PALANG[$var] + * @access public + */ public static function lang($var) { - return self::read(array('__LANG', $var)); + $value = self::read("__LANG.{$var}"); + if(!is_string($value)) { + throw new InvalidArgumentException("Expected string value for $var "); + } + return $value; } /** @@ -206,7 +252,7 @@ final class Config { * @access public */ public static function lang_f($var, $value) { - return self::read_f(array('__LANG', $var), $value); + return self::read_f('__LANG'. $var, $value); } /** diff --git a/model/DomainHandler.php b/model/DomainHandler.php index b140f0d1..42362aba 100644 --- a/model/DomainHandler.php +++ b/model/DomainHandler.php @@ -46,62 +46,62 @@ class DomainHandler extends PFAHandler { $this->struct=array( # field name allow display in... type $PALANG label $PALANG description default / options / ... # editing? form list - 'domain' => pacol($this->new, 1, 1, 'text', 'domain' , '' , '', '', + 'domain' => pacol($this->new, 1, 1, 'text', 'domain' , '' , '', array(), array('linkto' => 'list-virtual.php?domain=%s') ), 'description' => pacol($super, $super, $super, 'text', 'description' , '' ), # Aliases 'aliases' => pacol($super, $super, 0, 'num' , 'aliases' , 'pAdminEdit_domain_aliases_text' , Config::read('aliases') ), - 'alias_count' => pacol(0, 0, 1, 'vnum', '' , '' , '', '', + 'alias_count' => pacol(0, 0, 1, 'vnum', '' , '' , '', array(), /*not_in_db*/ 0, /*dont_write_to_db*/ 1, /*select*/ 'coalesce(__alias_count,0) - coalesce(__mailbox_count,0) as alias_count', /*extrafrom*/ 'left join ( select count(*) as __alias_count, domain as __alias_domain from ' . table_by_key('alias') . ' group by domain) as __alias on domain = __alias_domain'), - 'aliases_quot' => pacol(0, 0, 1, 'quot', 'aliases' , '' , 0, '', + 'aliases_quot' => pacol(0, 0, 1, 'quot', 'aliases' , '' , 0, array(), array('select' => db_quota_text( '__alias_count - coalesce(__mailbox_count,0)', 'aliases', 'aliases_quot')) ), - '_aliases_quot_percent' => pacol( 0, 0, 1, 'vnum', '' ,'' , 0, '', + '_aliases_quot_percent' => pacol( 0, 0, 1, 'vnum', '' ,'' , 0, array(), array('select' => db_quota_percent('__alias_count - coalesce(__mailbox_count,0)', 'aliases', '_aliases_quot_percent')) ), # Mailboxes 'mailboxes' => pacol($super, $super, 0, 'num' , 'mailboxes' , 'pAdminEdit_domain_aliases_text' , Config::read('mailboxes') ), - 'mailbox_count' => pacol(0, 0, 1, 'vnum', '' , '' , '', '', + 'mailbox_count' => pacol(0, 0, 1, 'vnum', '' , '' , '', array(), /*not_in_db*/ 0, /*dont_write_to_db*/ 1, /*select*/ 'coalesce(__mailbox_count,0) as mailbox_count', /*extrafrom*/ 'left join ( select count(*) as __mailbox_count, sum(quota) as __total_quota, domain as __mailbox_domain from ' . table_by_key('mailbox') . ' group by domain) as __mailbox on domain = __mailbox_domain'), - 'mailboxes_quot' => pacol(0, 0, 1, 'quot', 'mailboxes' , '' , 0, '', + 'mailboxes_quot' => pacol(0, 0, 1, 'quot', 'mailboxes' , '' , 0, array(), array('select' => db_quota_text( '__mailbox_count', 'mailboxes', 'mailboxes_quot')) ), - '_mailboxes_quot_percent' => pacol( 0, 0, 1, 'vnum', '' , '' , 0, '', + '_mailboxes_quot_percent' => pacol( 0, 0, 1, 'vnum', '' , '' , 0, array(), array('select' => db_quota_percent('__mailbox_count', 'mailboxes', '_mailboxes_quot_percent')) ), 'maxquota' => pacol($editquota,$editquota,$quota, 'num', 'pOverview_get_quota' , 'pAdminEdit_domain_maxquota_text' , Config::read('maxquota') ), # Domain quota 'quota' => pacol($edit_dom_q,$edit_dom_q, 0, 'num', 'pAdminEdit_domain_quota' , 'pAdminEdit_domain_maxquota_text' , Config::read('domain_quota_default') ), - 'total_quota' => pacol(0, 0, 1, 'vnum', '' , '' , '', '', + 'total_quota' => pacol(0, 0, 1, 'vnum', '' , '' , '', array(), array('select' => "$query_used_domainquota AS total_quota") /*extrafrom*//* already in mailbox_count */ ), - 'total_quot' => pacol( 0, 0, $dom_q, 'quot', 'pAdminEdit_domain_quota' , '' , 0, '', + 'total_quot' => pacol( 0, 0, $dom_q, 'quot', 'pAdminEdit_domain_quota' , '' , 0, array(), array('select' => db_quota_text( $query_used_domainquota, 'quota', 'total_quot')) ), - '_total_quot_percent'=> pacol( 0, 0, $dom_q, 'vnum', '' , '' , 0, '', + '_total_quot_percent'=> pacol( 0, 0, $dom_q, 'vnum', '' , '' , 0, array(), array('select' => db_quota_percent($query_used_domainquota, 'quota', '_total_quot_percent')) ), 'transport' => pacol($transp, $transp,$transp,'enum', 'transport' , 'pAdminEdit_domain_transport_text' , Config::read('transport_default') , - /*options*/ Config::read('transport_options') ), + /*options*/ Config::read_array('transport_options') ), 'backupmx' => pacol($super, $super, 1, 'bool', 'pAdminEdit_domain_backupmx' , '' , 0), 'active' => pacol($super, $super, 1, 'bool', 'active' , '' , 1 ), - 'default_aliases' => pacol($this->new, $this->new, 0, 'bool', 'pAdminCreate_domain_defaultaliases', '' , 1,'', /*not in db*/ 1 ), + 'default_aliases' => pacol($this->new, $this->new, 0, 'bool', 'pAdminCreate_domain_defaultaliases', '' , 1,array(), /*not in db*/ 1 ), 'created' => pacol(0, 0, 0, 'ts', 'created' , '' ), 'modified' => pacol(0, 0, $super, 'ts', 'last_modified' , '' ), 'password_expiry' => pacol($super, $super, $super, 'num', 'password_expiration' , 'password_expiration_desc', ''), '_can_edit' => pacol(0, 0, 1, 'int', '' , '' , 0 , - /*options*/ '', + /*options*/ array(), /*not_in_db*/ 0, /*dont_write_to_db*/ 1, /*select*/ $this->is_superadmin . ' as _can_edit' ), '_can_delete' => pacol(0, 0, 1, 'int', '' , '' , 0 , - /*options*/ '', + /*options*/ array(), /*not_in_db*/ 0, /*dont_write_to_db*/ 1, /*select*/ $this->is_superadmin . ' as _can_delete' ), @@ -146,7 +146,7 @@ class DomainHandler extends PFAHandler { return true; } - $this->errormsg[] = Config::Lang('edit_not_allowed', $this->id); + $this->errormsg[] = Config::Lang_f('edit_not_allowed', $this->id); return false; } @@ -156,7 +156,7 @@ class DomainHandler extends PFAHandler { */ protected function storemore() { if ($this->new && $this->values['default_aliases']) { - foreach (Config::read('default_aliases') as $address=>$goto) { + foreach (Config::read_array('default_aliases') as $address=>$goto) { $address = $address . "@" . $this->id; # if $goto doesn't contain @, let the alias point to the same domain if (!strstr($goto, '@')) { @@ -233,7 +233,7 @@ class DomainHandler extends PFAHandler { db_delete($this->db_table, $this->id_field, $this->id); if (!$this->domain_postdeletion()) { - $this->error_msg[] = Config::Lang('domain_postdel_failed'); + $this->errormsg[] = Config::Lang('domain_postdel_failed'); } db_log($this->id, 'delete_domain', $this->id); # TODO delete_domain is not a valid db_log keyword yet diff --git a/model/FetchmailHandler.php b/model/FetchmailHandler.php index 989d705d..729cfbef 100644 --- a/model/FetchmailHandler.php +++ b/model/FetchmailHandler.php @@ -83,9 +83,6 @@ class FetchmailHandler extends PFAHandler { ); } - protected function domain_from_id() { - # do nothing, setmore() does the work - } protected function setmore($values) { # set domain based on the target mailbox diff --git a/model/MailboxHandler.php b/model/MailboxHandler.php index d4132fc0..d0cde7dc 100644 --- a/model/MailboxHandler.php +++ b/model/MailboxHandler.php @@ -12,9 +12,9 @@ class MailboxHandler extends PFAHandler { # init $this->struct, $this->db_table and $this->id_field protected function initStruct() { - $passwordReset = Config::read('forgotten_user_password_reset'); + $passwordReset = (int) Config::bool('forgotten_user_password_reset'); $reset_by_sms = 0; - if ($passwordReset && Config::read('sms_send_function')) { + if ($passwordReset && Config::read_string('sms_send_function')) { $reset_by_sms = 1; } @@ -30,7 +30,7 @@ class MailboxHandler extends PFAHandler { 'maildir' => pacol($this->new, 0, 1, 'text', '' , '' , '' ), 'password' => pacol(1, 1, 0, 'pass', 'password' , 'pCreate_mailbox_password_text' , '' ), 'password2' => pacol(1, 1, 0, 'pass', 'password_again' , '' , '', - /*options*/ '', + /*options*/ array(), /*not_in_db*/ 0, /*dont_write_to_db*/ 1, /*select*/ 'password as password2' @@ -41,7 +41,7 @@ class MailboxHandler extends PFAHandler { # TODO: read used quota from quota/quota2 table 'active' => pacol(1, 1, 1, 'bool', 'active' , '' , 1 ), 'welcome_mail' => pacol($this->new, $this->new, 0, 'bool', 'pCreate_mailbox_mail' , '' , 1, - /*options*/ '', + /*options*/ array(), /*not_in_db*/ 1 ), 'phone' => pacol(1, $reset_by_sms, 0, 'text', 'pCreate_mailbox_phone' , 'pCreate_mailbox_phone_desc' , ''), 'email_other' => pacol(1, $passwordReset, 0, 'mail', 'pCreate_mailbox_email' , 'pCreate_mailbox_email_desc' , ''), @@ -97,7 +97,7 @@ class MailboxHandler extends PFAHandler { # } elseif ($maxquota < 0) { # TODO: show 'disabled' - at the moment, just shows '-1' } else { - $this->struct['quota']['desc'] = Config::lang_f('mb_max', $maxquota); + $this->struct['quota']['desc'] = Config::lang_f('mb_max', "" . $maxquota); } } @@ -219,7 +219,7 @@ class MailboxHandler extends PFAHandler { protected function beforestore() { if (isset($this->values['quota']) && $this->values['quota'] != -1) { - $this->values['quota'] = $this->values['quota'] * Config::read('quota_multiplier'); # convert quota from MB to bytes + $this->values['quota'] = $this->values['quota'] * Config::read_string('quota_multiplier'); # convert quota from MB to bytes } $ah = new AliasHandler($this->new, $this->admin_username); @@ -320,7 +320,7 @@ class MailboxHandler extends PFAHandler { db_delete($this->db_table, $this->id_field, $this->id); # finally delete the mailbox if (!$this->mailbox_postdeletion()) { - $this->error_msg[] = Config::Lang('mailbox_postdel_failed'); + $this->errormsg[] = Config::Lang('mailbox_postdel_failed'); } list(/*NULL*/, $domain) = explode('@', $this->id); @@ -408,9 +408,9 @@ class MailboxHandler extends PFAHandler { protected function _missing_maildir($field) { list($local_part, $domain) = explode('@', $this->id); - $maildir_name_hook = Config::read('maildir_name_hook'); + $maildir_name_hook = Config::read_string('maildir_name_hook'); - if ($maildir_name_hook != 'NO' && function_exists($maildir_name_hook)) { + if (is_string($maildir_name_hook) && $maildir_name_hook != 'NO' && function_exists($maildir_name_hook)) { $maildir = $maildir_name_hook($domain, $this->id); } elseif (Config::bool('domain_path')) { if (Config::bool('domain_in_mailbox')) { @@ -650,7 +650,7 @@ class MailboxHandler extends PFAHandler { return false; } - $s_host = Config::read('create_mailbox_subdirs_host'); + $s_host = Config::read_string('create_mailbox_subdirs_host'); if (empty($s_host)) { trigger_error('An IMAP/POP server host ($CONF["create_mailbox_subdirs_host"]) must be configured, if sub-folders are to be created', E_USER_ERROR); return false; @@ -670,7 +670,7 @@ class MailboxHandler extends PFAHandler { } $s_port=''; - $create_mailbox_subdirs_hostport = Config::read('create_mailbox_subdirs_hostport'); + $create_mailbox_subdirs_hostport = Config::read_string('create_mailbox_subdirs_hostport'); if (!empty($create_mailbox_subdirs_hostport)) { $s_port = $create_mailbox_subdirs_hostport; if (intval($s_port)!=$s_port) { @@ -690,7 +690,7 @@ class MailboxHandler extends PFAHandler { return false; } - $s_prefix = Config::read('create_mailbox_subdirs_prefix'); + $s_prefix = Config::read_string('create_mailbox_subdirs_prefix'); foreach ($create_mailbox_subdirs as $f) { $f='{'.$s_host.'}'.$s_prefix.$f; $res=imap_createmailbox($i, $f); diff --git a/model/PFAHandler.php b/model/PFAHandler.php index 169b88af..b735d1e3 100644 --- a/model/PFAHandler.php +++ b/model/PFAHandler.php @@ -97,7 +97,10 @@ abstract class PFAHandler { # will be set to 0 if $admin_username is set and is not a superadmin protected $is_superadmin = 1; - # if set, switch to user (non-admin) mode + /** + * @var string $username + * if set, switch to user (non-admin) mode + */ protected $username = ''; # will be set to 0 if a user (non-admin) is logged in @@ -159,9 +162,9 @@ abstract class PFAHandler { /** * Constructor: fill $struct etc. - * @param integer - 0 is edit mode, set to 1 to switch to create mode - * @param string - if an admin_username is specified, permissions will be restricted to the domains this admin may manage - * @param integer - 0 if logged in as user, 1 if logged in as admin or superadmin + * @param int $new - 0 is edit mode, set to 1 to switch to create mode + * @param string $username - if an admin_username is specified, permissions will be restricted to the domains this admin may manage + * @param int $is_admin - 0 if logged in as user, 1 if logged in as admin or superadmin */ public function __construct($new = 0, $username = "", $is_admin = 1) { # set label_field if not explicitely set @@ -207,7 +210,7 @@ abstract class PFAHandler { $this->initStruct(); if (!isset($this->struct['_can_edit'])) { - $this->struct['_can_edit'] = pacol(0, 0, 1, 'vnum', '' , '' , '', '', + $this->struct['_can_edit'] = pacol(0, 0, 1, 'vnum', '' , '' , '', array(), /*not_in_db*/ 0, /*dont_write_to_db*/ 1, /*select*/ '1 as _can_edit' @@ -215,7 +218,7 @@ abstract class PFAHandler { } if (!isset($this->struct['_can_delete'])) { - $this->struct['_can_delete'] = pacol(0, 0, 1, 'vnum', '' , '' , '', '', + $this->struct['_can_delete'] = pacol(0, 0, 1, 'vnum', '' , '' , '', array(), /*not_in_db*/ 0, /*dont_write_to_db*/ 1, /*select*/ '1 as _can_delete' @@ -223,7 +226,7 @@ abstract class PFAHandler { } $struct_hook = Config::read($this->db_table . '_struct_hook'); - if ($struct_hook != 'NO' && function_exists($struct_hook)) { + if (!empty($struct_hook) && is_string($struct_hook) && $struct_hook != 'NO' && function_exists($struct_hook)) { $this->struct = $struct_hook($this->struct); } @@ -727,7 +730,9 @@ abstract class PFAHandler { $db_result = array(); if ($result['rows'] != 0) { while ($row = db_assoc($result['result'])) { - $db_result[$row[$this->id_field]] = $row; + if(is_array($row)) { + $db_result[$row[$this->id_field]] = $row; + } } } @@ -822,6 +827,9 @@ abstract class PFAHandler { $result = db_query($query); if ($result['rows'] == 1) { $row = db_assoc($result['result']); + if(!is_array($row)) { + return false; + } $crypt_password = pacrypt($password, $row['password']); if ($row['password'] == $crypt_password) { @@ -867,6 +875,10 @@ abstract class PFAHandler { $result = db_query($query); if ($result['rows'] == 1) { $row = db_assoc($result['result']); + + if(!is_array($row)) { + return false; + } $crypt_token = pacrypt($token, $row['token']); if ($row['token'] == $crypt_token) { diff --git a/model/Shell.php b/model/Shell.php index 3f5141e4..fa6ea28f 100644 --- a/model/Shell.php +++ b/model/Shell.php @@ -141,7 +141,7 @@ class Shell { * @param string $default Default input value. * @return string either the default value, or the user-provided input. */ - public function in($prompt, $options = null, $default = null) { + public function in($prompt, $options = null, $default = '') { if (!$this->interactive) { return $default; } diff --git a/model/VacationHandler.php b/model/VacationHandler.php index c9ed41d2..30e5ac3d 100644 --- a/model/VacationHandler.php +++ b/model/VacationHandler.php @@ -196,6 +196,10 @@ class VacationHandler extends PFAHandler { } $row = db_assoc($result['result']); + + if(!is_array($row)) { + return false; + } $boolean = ($row['active'] == db_get_boolean(true)); # TODO: only return true and store the db result array in $this->whatever for consistency with the other classes return array( diff --git a/public/backup.php b/public/backup.php index 23647e2e..2e0fe57e 100644 --- a/public/backup.php +++ b/public/backup.php @@ -108,7 +108,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") { while ($row = db_assoc($result['result'])) { $fields = array_keys($row); $values = array_values($row); - $values = array_map('escape_string', $values); + $values = array_map(function($str) { return escape_string($str); }, $values); fwrite($fh, "INSERT INTO ". $tables[$i] . " (". implode(',', $fields) . ") VALUES ('" . implode('\',\'', $values) . "');\n"); $fields = ""; diff --git a/public/broadcast-message.php b/public/broadcast-message.php index 38a1b5ff..9c875cbc 100644 --- a/public/broadcast-message.php +++ b/public/broadcast-message.php @@ -66,7 +66,9 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") { $result = db_query($q); if ($result['rows'] > 0) { while ($row = db_assoc($result['result'])) { - $recipients[] = $row['username']; + if(is_array($row)) { + $recipients[] = $row['username']; + } } } diff --git a/public/index.php b/public/index.php index ab0fe7a0..0ed4743f 100644 --- a/public/index.php +++ b/public/index.php @@ -22,11 +22,13 @@ $CONF = array('configured' => false); +clearstatcache(); + if (file_exists(dirname(__FILE__) . '/../config.inc.php')) { require_once(dirname(__FILE__) . '/../config.inc.php'); } -if ($CONF['configured'] === true) { +if ($CONF['configured']) { header("Location: login.php"); exit; } diff --git a/public/list-virtual.php b/public/list-virtual.php index b15875b3..d1f168c9 100644 --- a/public/list-virtual.php +++ b/public/list-virtual.php @@ -59,6 +59,10 @@ if ((is_array($list_domains) and sizeof($list_domains) > 0)) { } } +if (!is_string($fDomain)) { + die(Config::Lang('invalid_parameter')); +} + if (!in_array($fDomain, $list_domains)) { flash_error($PALANG['invalid_parameter']); unset($_SESSION['list-virtual:domain']); @@ -226,6 +230,9 @@ if ($result['rows'] > 0) { $goto_single_rec_del = ""; while ($row = db_assoc($result['result'])) { + if(!is_array($row)) { + continue; + } if ($display_mailbox_aliases) { $goto_split = explode(",", $row['goto']); $row['goto_mailbox'] = 0; diff --git a/public/login.php b/public/login.php index ef1574a8..9658ccd8 100644 --- a/public/login.php +++ b/public/login.php @@ -88,7 +88,7 @@ $_SESSION['PFA_token'] = md5(uniqid(rand(), true)); $smarty->assign('language_selector', language_selector(), false); $smarty->assign('smarty_template', 'login'); $smarty->assign('logintype', 'admin'); -$smarty->assign('forgotten_password_reset', Config::read('forgotten_admin_password_reset')); +$smarty->assign('forgotten_password_reset', Config::bool('forgotten_admin_password_reset')); $smarty->display('index.tpl'); /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ diff --git a/public/upgrade.php b/public/upgrade.php index 7e5cfe05..9dc120ad 100644 --- a/public/upgrade.php +++ b/public/upgrade.php @@ -3,6 +3,9 @@ if (!defined('POSTFIXADMIN')) { require_once('common.php'); } +if(!isset($CONF) || !is_array($CONF)) { + die("config.inc.php seems invalid"); +} /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ # @version $Id$ @@ -12,7 +15,7 @@ if (!defined('POSTFIXADMIN')) { /** * Use this to check whether an object (Table, index etc) exists within a * PostgreSQL database. - * @param String the object name + * @param string the object name * @return boolean true if it exists */ function _pgsql_object_exists($name) { @@ -24,6 +27,11 @@ function _pgsql_object_exists($name) { return false; } +/** + * @param string $table + * @param string $field + * @return bool + */ function _pgsql_field_exists($table, $field) { # $table = table_by_key($table); # _pgsql_field_exists is always called with the expanded table name - don't expand it twice $sql = ' @@ -97,7 +105,7 @@ function _db_add_field($table, $field, $fieldtype, $after = '') { } if (! _db_field_exists(table_by_key($table), $field)) { - $result = db_query_parsed($query); + db_query_parsed($query); } else { printdebug("field already exists: $table.$field"); } @@ -218,7 +226,6 @@ function _do_upgrade($current_version) { } } // Update config table so we don't run the same query twice in the future. - $i = (int) $i; $table = table_by_key('config'); $sql = "UPDATE $table SET value = $i WHERE name = 'version'"; db_query($sql); @@ -227,10 +234,10 @@ function _do_upgrade($current_version) { /** * Replaces database specific parts in a query - * @param String sql query with placeholders + * @param string sql query with placeholders * @param int (optional) whether errors should be ignored (0=false) - * @param String (optional) MySQL specific code to attach, useful for COMMENT= on CREATE TABLE - * @return String sql query + * @param string (optional) MySQL specific code to attach, useful for COMMENT= on CREATE TABLE + * @return void */ function db_query_parsed($sql, $ignore_errors = 0, $attach_mysql = "") { @@ -303,7 +310,7 @@ function db_query_parsed($sql, $ignore_errors = 0, $attach_mysql = "") { '{DATECURRENT}' => 'timestamp with time zone default now()', ); } else { - echo "Sorry, unsupported database type " . $conf['database_type']; + echo "Sorry, unsupported database type " . $CONF['database_type']; exit; } @@ -312,14 +319,15 @@ function db_query_parsed($sql, $ignore_errors = 0, $attach_mysql = "") { $query = trim(str_replace(array_keys($replace), $replace, $sql)); - if (safeget('debug') != "") { + $debug = safeget('debug', '') != ''; + + if ($debug) { printdebug($query); } $result = db_query($query, $ignore_errors); - if (safeget('debug') != "") { + if ($debug) { print "
" . $result['error'] . "
"; } - return $result; } function _drop_index($table, $index) { @@ -331,7 +339,7 @@ function _drop_index($table, $index) { } elseif ($CONF['database_type'] == 'pgsql' || db_sqlite()) { return "DROP INDEX $index"; # Index names are unique with a DB for PostgreSQL } else { - echo "Sorry, unsupported database type " . $conf['database_type']; + echo "Sorry, unsupported database type " . $CONF['database_type']; exit; } } @@ -347,7 +355,7 @@ function _add_index($table, $indexname, $fieldlist) { $pgindexname = $table . "_" . $indexname . '_idx'; return "CREATE INDEX $pgindexname ON $table($fieldlist);"; # Index names are unique with a DB for PostgreSQL } else { - echo "Sorry, unsupported database type " . $conf['database_type']; + echo "Sorry, unsupported database type " . $CONF['database_type']; exit; } } @@ -472,10 +480,10 @@ function upgrade_2_mysql() { # from TABLE_BACKUP_MX.TXT $table_domain = table_by_key('domain'); if (!_mysql_field_exists($table_domain, 'transport')) { - $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255) AFTER maxquota;", true); + db_query_parsed("ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255) AFTER maxquota;", true); } if (!_mysql_field_exists($table_domain, 'backupmx')) { - $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN backupmx {BOOLEAN} AFTER transport;", true); + db_query_parsed("ALTER TABLE $table_domain ADD COLUMN backupmx {BOOLEAN} AFTER transport;", true); } } @@ -600,8 +608,8 @@ function upgrade_2_pgsql() { // this handles anyone who is upgrading... (and should have no impact on new installees) $table_domain = table_by_key('domain'); - $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255)", true); - $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN backupmx BOOLEAN DEFAULT false", true); + db_query_parsed("ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255)", true); + db_query_parsed("ALTER TABLE $table_domain ADD COLUMN backupmx BOOLEAN DEFAULT false", true); } function upgrade_3_mysql() { @@ -680,7 +688,7 @@ function upgrade_3_mysql() { function upgrade_4_mysql() { # MySQL only # changes between 2.1 and moving to sourceforge $table_domain = table_by_key('domain'); - $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN quota int(10) NOT NULL default '0' AFTER maxquota", true); + db_query_parsed("ALTER TABLE $table_domain ADD COLUMN quota int(10) NOT NULL default '0' AFTER maxquota", true); # Possible errors that can be ignored: # - Invalid query: Table 'postfix.domain' doesn't exist } @@ -699,25 +707,25 @@ function upgrade_4_pgsql() { $table_vacation_notification = table_by_key('vacation_notification'); if (!_pgsql_field_exists($table_domain, 'quota')) { - $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN quota int NOT NULL default '0'"); + db_query_parsed("ALTER TABLE $table_domain ADD COLUMN quota int NOT NULL default '0'"); } - $result = db_query_parsed("ALTER TABLE $table_domain ALTER COLUMN domain DROP DEFAULT"); + db_query_parsed("ALTER TABLE $table_domain ALTER COLUMN domain DROP DEFAULT"); if (!_pgsql_object_exists('domain_domain_active')) { - $result = db_query_parsed("CREATE INDEX domain_domain_active ON $table_domain(domain,active)"); + db_query_parsed("CREATE INDEX domain_domain_active ON $table_domain(domain,active)"); } - $result = db_query_parsed("ALTER TABLE $table_domain_admins ALTER COLUMN domain DROP DEFAULT"); - $result = db_query_parsed("ALTER TABLE $table_alias ALTER COLUMN address DROP DEFAULT"); - $result = db_query_parsed("ALTER TABLE $table_alias ALTER COLUMN domain DROP DEFAULT"); + db_query_parsed("ALTER TABLE $table_domain_admins ALTER COLUMN domain DROP DEFAULT"); + db_query_parsed("ALTER TABLE $table_alias ALTER COLUMN address DROP DEFAULT"); + db_query_parsed("ALTER TABLE $table_alias ALTER COLUMN domain DROP DEFAULT"); if (!_pgsql_object_exists('alias_address_active')) { - $result = db_query_parsed("CREATE INDEX alias_address_active ON $table_alias(address,active)"); + db_query_parsed("CREATE INDEX alias_address_active ON $table_alias(address,active)"); } - $result = db_query_parsed("ALTER TABLE $table_domain_admins ALTER COLUMN username DROP DEFAULT"); - $result = db_query_parsed("ALTER TABLE $table_domain_admins ALTER COLUMN domain DROP DEFAULT"); + db_query_parsed("ALTER TABLE $table_domain_admins ALTER COLUMN username DROP DEFAULT"); + db_query_parsed("ALTER TABLE $table_domain_admins ALTER COLUMN domain DROP DEFAULT"); - $result = db_query_parsed(" + db_query_parsed(" BEGIN; ALTER TABLE $table_log RENAME COLUMN data TO data_old; ALTER TABLE $table_log ADD COLUMN data text NOT NULL default ''; @@ -725,10 +733,10 @@ function upgrade_4_pgsql() { ALTER TABLE $table_log DROP COLUMN data_old; COMMIT;"); - $result = db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN username DROP DEFAULT"); - $result = db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN domain DROP DEFAULT"); + db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN username DROP DEFAULT"); + db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN domain DROP DEFAULT"); - $result = db_query_parsed( + db_query_parsed( " BEGIN; ALTER TABLE $table_mailbox RENAME COLUMN domain TO domain_old; @@ -742,12 +750,12 @@ function upgrade_4_pgsql() { } - $result = db_query_parsed("ALTER TABLE $table_vacation ALTER COLUMN body SET DEFAULT ''"); + db_query_parsed("ALTER TABLE $table_vacation ALTER COLUMN body SET DEFAULT ''"); if (_pgsql_field_exists($table_vacation, 'cache')) { - $result = db_query_parsed("ALTER TABLE $table_vacation DROP COLUMN cache"); + db_query_parsed("ALTER TABLE $table_vacation DROP COLUMN cache"); } - $result = db_query_parsed(" + db_query_parsed(" BEGIN; ALTER TABLE $table_vacation RENAME COLUMN domain to domain_old; ALTER TABLE $table_vacation ADD COLUMN domain varchar(255) REFERENCES $table_domain; @@ -757,11 +765,11 @@ function upgrade_4_pgsql() { "); if (!_pgsql_object_exists('vacation_email_active')) { - $result = db_query_parsed("CREATE INDEX vacation_email_active ON $table_vacation(email,active)"); + db_query_parsed("CREATE INDEX vacation_email_active ON $table_vacation(email,active)"); } if (!_pgsql_object_exists($table_vacation_notification)) { - $result = db_query_parsed(" + db_query_parsed(" CREATE TABLE $table_vacation_notification ( on_vacation character varying(255) NOT NULL REFERENCES $table_vacation(email) ON DELETE CASCADE, notified character varying(255) NOT NULL, @@ -785,7 +793,7 @@ function upgrade_4_pgsql() { * - removed creation of default superadmin */ function upgrade_5_mysql() { - $result = db_query_parsed(" + db_query_parsed(" CREATE TABLE {IF_NOT_EXISTS} " . table_by_key('admin') . " ( `username` varchar(255) NOT NULL default '', `password` varchar(255) NOT NULL default '', @@ -796,7 +804,7 @@ function upgrade_5_mysql() { KEY username (`username`) ) DEFAULT {LATIN1} COMMENT='Postfix Admin - Virtual Admins'; "); - $result = db_query_parsed(" + db_query_parsed(" CREATE TABLE {IF_NOT_EXISTS} " . table_by_key('alias') . " ( `address` varchar(255) NOT NULL default '', `goto` text NOT NULL, @@ -809,7 +817,7 @@ function upgrade_5_mysql() { ) DEFAULT {LATIN1} COMMENT='Postfix Admin - Virtual Aliases'; "); - $result = db_query_parsed(" + db_query_parsed(" CREATE TABLE {IF_NOT_EXISTS} " . table_by_key('domain') . " ( `domain` varchar(255) NOT NULL default '', `description` varchar(255) NOT NULL default '', @@ -827,7 +835,7 @@ function upgrade_5_mysql() { ) DEFAULT {LATIN1} COMMENT='Postfix Admin - Virtual Domains'; "); - $result = db_query_parsed(" + db_query_parsed(" CREATE TABLE {IF_NOT_EXISTS} " . table_by_key('domain_admins') . " ( `username` varchar(255) NOT NULL default '', `domain` varchar(255) NOT NULL default '', @@ -837,7 +845,7 @@ function upgrade_5_mysql() { ) DEFAULT {LATIN1} COMMENT='Postfix Admin - Domain Admins'; "); - $result = db_query_parsed(" + db_query_parsed(" CREATE TABLE {IF_NOT_EXISTS} " . table_by_key('log') . " ( `timestamp` {DATETIME}, `username` varchar(255) NOT NULL default '', @@ -848,7 +856,7 @@ function upgrade_5_mysql() { ) DEFAULT {LATIN1} COMMENT='Postfix Admin - Log'; "); - $result = db_query_parsed(" + db_query_parsed(" CREATE TABLE {IF_NOT_EXISTS} " . table_by_key('mailbox') . " ( `username` varchar(255) NOT NULL default '', `password` varchar(255) NOT NULL default '', @@ -864,7 +872,7 @@ function upgrade_5_mysql() { ) DEFAULT {LATIN1} COMMENT='Postfix Admin - Virtual Mailboxes'; "); - $result = db_query_parsed(" + db_query_parsed(" CREATE TABLE {IF_NOT_EXISTS} " . table_by_key('vacation') . " ( `email` varchar(255) NOT NULL , `subject` varchar(255) NOT NULL, @@ -883,10 +891,10 @@ function upgrade_5_mysql() { * drop useless indicies (already available as primary key) */ function upgrade_79_mysql() { # MySQL only - $result = db_query_parsed(_drop_index('admin', 'username'), true); - $result = db_query_parsed(_drop_index('alias', 'address'), true); - $result = db_query_parsed(_drop_index('domain', 'domain'), true); - $result = db_query_parsed(_drop_index('mailbox', 'username'), true); + db_query_parsed(_drop_index('admin', 'username'), true); + db_query_parsed(_drop_index('alias', 'address'), true); + db_query_parsed(_drop_index('domain', 'domain'), true); + db_query_parsed(_drop_index('mailbox', 'username'), true); } function upgrade_81_mysql() { # MySQL only @@ -905,7 +913,7 @@ function upgrade_81_mysql() { # MySQL only ")); foreach ($all_sql as $sql) { - $result = db_query_parsed($sql, true); + db_query_parsed($sql, true); } } @@ -913,9 +921,9 @@ function upgrade_81_mysql() { # MySQL only * Make logging translatable - i.e. create alias => create_alias */ function upgrade_90_mysql_pgsql() { - $result = db_query_parsed("UPDATE " . table_by_key('log') . " SET action = REPLACE(action,' ','_')", true); + db_query_parsed("UPDATE " . table_by_key('log') . " SET action = REPLACE(action,' ','_')", true); # change edit_alias_state to edit_alias_active - $result = db_query_parsed("UPDATE " . table_by_key('log') . " SET action = 'edit_alias_state' WHERE action = 'edit_alias_active'", true); + db_query_parsed("UPDATE " . table_by_key('log') . " SET action = 'edit_alias_state' WHERE action = 'edit_alias_active'", true); } /** @@ -924,9 +932,9 @@ function upgrade_90_mysql_pgsql() { function upgrade_169_mysql() { $table_domain = table_by_key('domain'); $table_mailbox = table_by_key('mailbox'); - $result = db_query_parsed("ALTER TABLE $table_domain MODIFY COLUMN `quota` bigint(20) NOT NULL default '0'", true); - $result = db_query_parsed("ALTER TABLE $table_domain MODIFY COLUMN `maxquota` bigint(20) NOT NULL default '0'", true); - $result = db_query_parsed("ALTER TABLE $table_mailbox MODIFY COLUMN `quota` bigint(20) NOT NULL default '0'", true); + db_query_parsed("ALTER TABLE $table_domain MODIFY COLUMN `quota` bigint(20) NOT NULL default '0'", true); + db_query_parsed("ALTER TABLE $table_domain MODIFY COLUMN `maxquota` bigint(20) NOT NULL default '0'", true); + db_query_parsed("ALTER TABLE $table_mailbox MODIFY COLUMN `quota` bigint(20) NOT NULL default '0'", true); } @@ -963,7 +971,7 @@ function upgrade_318_mysql() { # (not a great loss) and re-create it using this function. foreach ($all_sql as $sql) { - $result = db_query_parsed($sql); + db_query_parsed($sql); } } @@ -1090,7 +1098,7 @@ function upgrade_373_mysql() { # MySQL only ")); foreach ($all_sql as $sql) { - $result = db_query_parsed($sql); + db_query_parsed($sql); } } @@ -1162,7 +1170,7 @@ function upgrade_473_mysql() { ")); foreach ($all_sql as $sql) { - $result = db_query_parsed($sql); + db_query_parsed($sql); } } @@ -1408,6 +1416,10 @@ function upgrade_1284_mysql_pgsql() { if ($result['rows'] > 0) { while ($row = db_assoc($result['result'])) { + if(!is_array($row)) { + break; + } + printdebug("Setting superadmin flag for " . $row['username']); db_update('admin', 'username', $row['username'], array('superadmin' => db_get_boolean(true))); } @@ -1676,7 +1688,7 @@ function upgrade_1836_mysql() { ")); foreach ($all_sql as $sql) { - $result = db_query_parsed($sql, true); + db_query_parsed($sql, true); } } diff --git a/public/users/password-recover.php b/public/users/password-recover.php index 96927157..410c038c 100644 --- a/public/users/password-recover.php +++ b/public/users/password-recover.php @@ -58,6 +58,11 @@ function sendCodebySMS($to, $username, $code) { if ($_SERVER['REQUEST_METHOD'] === "POST") { $start_time = microtime(true); $tUsername = escape_string(safepost('fUsername')); + + if(empty($tUsername) || !is_string($tUsername)) { + die("fUsername field required"); + } + $handler = $context === 'admin' ? new AdminHandler : new MailboxHandler; $token = $handler->getPasswordRecoveryCode($tUsername); if ($token !== false) { @@ -65,8 +70,8 @@ if ($_SERVER['REQUEST_METHOD'] === "POST") { $result = db_query("SELECT * FROM $table WHERE username='$tUsername'"); $row = db_assoc($result['result']); - $email_other = trim($row['email_other']); - $phone = trim($row['phone']); + $email_other = isset($row['email_other']) ? trim($row['email_other']) : null; + $phone = isset($row['phone']) ? trim($row['phone']) : null; if ($email_other) { sendCodeByEmail($email_other, $tUsername, $token); diff --git a/public/viewlog.php b/public/viewlog.php index 0d97a878..05238e74 100644 --- a/public/viewlog.php +++ b/public/viewlog.php @@ -55,7 +55,6 @@ if (! (check_owner($SESSID_USERNAME, $fDomain) || authentication_has_role('globa flash_error($PALANG['pViewlog_result_error']); } -// we need to initialize $tLog as an array! $tLog = array(); if ($error != 1) { @@ -66,19 +65,22 @@ if ($error != 1) { if (db_pgsql()) { $query = "SELECT extract(epoch from timestamp) as timestamp,username,domain,action,data FROM $table_log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT $page_size"; } - $result=db_query($query); + $result = db_query($query); if ($result['rows'] > 0) { while ($row = db_assoc($result['result'])) { - if (db_pgsql()) { - $row['timestamp']=gmstrftime('%c %Z', $row['timestamp']); + if (is_array($row) && db_pgsql()) { + $row['timestamp'] = gmstrftime('%c %Z', $row['timestamp']); } $tLog[] = $row; } } } -for ($i = 0; $i < count($tLog); $i++) { - $tLog[$i]['action'] = $PALANG ['pViewlog_action_'.$tLog [$i]['action']]; +foreach($tLog as $k => $v) { + if(isset($v['action'])) { + $v['action'] = $PALANG['pViewlog_action_' . $v['action']]; + $tLog[$k] = $v; + } } $smarty->assign('domain_list', $list_domains); diff --git a/public/xmlrpc.php b/public/xmlrpc.php index d2afb70d..95cc923a 100644 --- a/public/xmlrpc.php +++ b/public/xmlrpc.php @@ -162,7 +162,7 @@ class AliasProxy { $ah = new AliasHandler(); $ah->init($_SESSION['sessid']['username']); - $values['goto'] = $addresses; + $values = ['goto' => $addresses]; if ($flags == 'forward_and_store') { $values['goto_mailbox'] = 1; diff --git a/templates/header.php b/templates/header.php index d72fbbdb..0edfcf70 100644 --- a/templates/header.php +++ b/templates/header.php @@ -1,5 +1,9 @@ - -