From 641b6114cbc90319f34e335bec5667407780d8f1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2020 06:24:45 +0000 Subject: [PATCH 1/2] Bump guzzlehttp/guzzle from 6.5.2 to 6.5.3 Bumps [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/guzzle/guzzle/releases) - [Changelog](https://github.com/guzzle/guzzle/blob/6.5.3/CHANGELOG.md) - [Commits](https://github.com/guzzle/guzzle/compare/6.5.2...6.5.3) Signed-off-by: dependabot-preview[bot] --- composer.lock | 131 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 124 insertions(+), 7 deletions(-) diff --git a/composer.lock b/composer.lock index d1e3cdc..782976e 100644 --- a/composer.lock +++ b/composer.lock @@ -353,23 +353,24 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.2", + "version": "6.5.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "43ece0e75098b7ecd8d13918293029e555a50f82" + "reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82", - "reference": "43ece0e75098b7ecd8d13918293029e555a50f82", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/aab4ebd862aa7d04f01a4b51849d657db56d882e", + "reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.0", "guzzlehttp/psr7": "^1.6.1", - "php": ">=5.5" + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.11" }, "require-dev": { "ext-curl": "*", @@ -377,7 +378,6 @@ "psr/log": "^1.1" }, "suggest": { - "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", @@ -416,7 +416,7 @@ "rest", "web service" ], - "time": "2019-12-23T11:57:10+00:00" + "time": "2020-04-18T10:38:46+00:00" }, { "name": "guzzlehttp/promises", @@ -2360,6 +2360,68 @@ ], "time": "2019-11-27T13:56:44+00:00" }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf", + "reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "time": "2020-03-09T19:04:49+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.11.0", @@ -2419,6 +2481,61 @@ ], "time": "2019-02-06T07:57:58+00:00" }, + { + "name": "symfony/polyfill-php72", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "37b0976c78b94856543260ce09b460a7bc852747" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/37b0976c78b94856543260ce09b460a7bc852747", + "reference": "37b0976c78b94856543260ce09b460a7bc852747", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-02-27T09:26:54+00:00" + }, { "name": "symfony/translation", "version": "v3.4.1", From cd2607e1d3e2d3b8d39a4a6a2b1edd329bd481f7 Mon Sep 17 00:00:00 2001 From: Christopher Wilkinson Date: Mon, 20 Apr 2020 06:24:54 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- generated-classes/TechWilk/Rota/User.php | 4 +- generated-conf/config.php | 44 +++++----- .../PropelMigration_1494860053.php | 8 +- public/api/v1/index.php | 86 +++++++++---------- public/old/createEvent.php | 30 +++---- public/old/editRole.php | 4 +- public/old/editeventtype.php | 16 ++-- public/old/emailEvent.php | 8 +- public/old/emailGroup.php | 8 +- public/old/includes/footer.php | 8 +- public/old/includes/functions.database.php | 8 +- public/old/includes/functions.discussion.php | 4 +- public/old/includes/functions.facebook.php | 8 +- public/old/includes/functions.mail.php | 22 ++--- .../old/includes/functions.notifications.php | 22 ++--- public/old/includes/header.php | 23 +++-- public/old/license.php | 2 +- public/old/linkSocialAuth.php | 14 +-- public/old/overview.php | 6 +- public/old/pendingAccounts.php | 12 +-- .../samples/old/assets/posteddata.php | 6 +- public/old/recordingUpload.php | 17 ++-- public/old/series.php | 4 +- public/old/settings.php | 28 +++--- public/old/swap.php | 34 ++++---- public/old/swaps.php | 16 ++-- .../samples/old/assets/posteddata.php | 6 +- src/classes/Controller/InstallController.php | 5 +- tests/Integration/BaseTestCase.php | 26 +++--- tests/Unit/BaseTestCase.php | 26 +++--- tests/Unit/CryptTest.php | 40 ++++----- tests/Unit/EmailAddressTest.php | 14 +-- 32 files changed, 282 insertions(+), 277 deletions(-) diff --git a/generated-classes/TechWilk/Rota/User.php b/generated-classes/TechWilk/Rota/User.php index 8ec997a..b797483 100644 --- a/generated-classes/TechWilk/Rota/User.php +++ b/generated-classes/TechWilk/Rota/User.php @@ -70,8 +70,8 @@ public function setPassword($v) if (!password_verify($v, $this->password)) { $bcrypt_options = [ - 'cost' => 12, - ]; + 'cost' => 12, + ]; $this->password = password_hash($v, PASSWORD_BCRYPT, $bcrypt_options); $this->modifiedColumns[UserTableMap::COL_PASSWORD] = true; diff --git a/generated-conf/config.php b/generated-conf/config.php index 1195e3a..dd115f7 100644 --- a/generated-conf/config.php +++ b/generated-conf/config.php @@ -7,18 +7,18 @@ $serviceContainer->setAdapterClass('default', 'mysql'); $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); $manager->setConfiguration([ - 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', - 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], - 'user' => $config['db']['user'], - 'password' => $config['db']['pass'], - 'attributes' => [ - 'ATTR_EMULATE_PREPARES' => false, - 'ATTR_TIMEOUT' => 30, - ], - 'model_paths' => [ - 0 => 'src', - 1 => 'vendor', - ], + 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', + 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], + 'user' => $config['db']['user'], + 'password' => $config['db']['pass'], + 'attributes' => [ + 'ATTR_EMULATE_PREPARES' => false, + 'ATTR_TIMEOUT' => 30, + ], + 'model_paths' => [ + 0 => 'src', + 1 => 'vendor', + ], ]); $manager->setName('default'); $serviceContainer->setConnectionManager('default', $manager); @@ -26,16 +26,16 @@ $serviceContainer->setAdapterClass('test', 'sqlite'); $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); $manager->setConfiguration([ - 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', - 'dsn' => 'sqlite:/var/tmp/test.db', - 'attributes' => [ - 'ATTR_EMULATE_PREPARES' => false, - 'ATTR_TIMEOUT' => 30, - ], - 'model_paths' => [ - 0 => 'src', - 1 => 'vendor', - ], + 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', + 'dsn' => 'sqlite:/var/tmp/test.db', + 'attributes' => [ + 'ATTR_EMULATE_PREPARES' => false, + 'ATTR_TIMEOUT' => 30, + ], + 'model_paths' => [ + 0 => 'src', + 1 => 'vendor', + ], ]); $manager->setName('test'); $serviceContainer->setConnectionManager('test', $manager); diff --git a/generated-migrations/PropelMigration_1494860053.php b/generated-migrations/PropelMigration_1494860053.php index 468dd15..9bfeb5c 100644 --- a/generated-migrations/PropelMigration_1494860053.php +++ b/generated-migrations/PropelMigration_1494860053.php @@ -40,7 +40,7 @@ public function postDown(MigrationManager $manager) public function getUpSQL() { return [ - 'default' => ' + 'default' => ' # This is a fix for InnoDB in MySQL >= 4.1.x # It "suspends judgement" for fkey relationships until are tables are set. SET FOREIGN_KEY_CHECKS = 0; @@ -160,7 +160,7 @@ public function getUpSQL() # This restores the fkey checks, after having unset them earlier SET FOREIGN_KEY_CHECKS = 1; ', -]; + ]; } /** @@ -172,7 +172,7 @@ public function getUpSQL() public function getDownSQL() { return [ - 'default' => ' + 'default' => ' # This is a fix for InnoDB in MySQL >= 4.1.x # It "suspends judgement" for fkey relationships until are tables are set. SET FOREIGN_KEY_CHECKS = 0; @@ -270,6 +270,6 @@ public function getDownSQL() # This restores the fkey checks, after having unset them earlier SET FOREIGN_KEY_CHECKS = 1; ', -]; + ]; } } diff --git a/public/api/v1/index.php b/public/api/v1/index.php index 5fe8861..72fdeee 100644 --- a/public/api/v1/index.php +++ b/public/api/v1/index.php @@ -17,68 +17,66 @@ function isAdmin() } } -if (isAdmin()): +if (isAdmin()) { // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Start of API -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Start of API + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -require_once __DIR__.'/../../../vendor/autoload.php'; + require_once __DIR__.'/../../../vendor/autoload.php'; -require_once __DIR__.'/../../../generated-conf/config.php'; + require_once __DIR__.'/../../../generated-conf/config.php'; -// Create and configure Slim app -$app = new \Slim\App(['settings' => $config]); + // Create and configure Slim app + $app = new \Slim\App(['settings' => $config]); -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Containers for DI -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Containers for DI + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -$container = $app->getContainer(); + $container = $app->getContainer(); -$container['db'] = function ($c) { - $db_config = $c['settings']['db']; - $db = new Database($db_config); + $container['db'] = function ($c) { + $db_config = $c['settings']['db']; + $db = new Database($db_config); - return $db; -}; + return $db; + }; -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Define app routes -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Define app routes + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// ~~~~~~~~~~~~~~~ Series ~~~~~~~~~~~~~~~ + // ~~~~~~~~~~~~~~~ Series ~~~~~~~~~~~~~~~ -$app->post('/series', function ($request, $response, $args) { - $postData = $request->getParsedBody(); + $app->post('/series', function ($request, $response, $args) { + $postData = $request->getParsedBody(); - $name = filter_var($postData['name'], FILTER_SANITIZE_STRING); - $description = filter_var($postData['description'], FILTER_SANITIZE_STRING); + $name = filter_var($postData['name'], FILTER_SANITIZE_STRING); + $description = filter_var($postData['description'], FILTER_SANITIZE_STRING); - $series = new EventGroup(); - $series->setName($name); - $series->setDescription($description); - $series->save(); + $series = new EventGroup(); + $series->setName($name); + $series->setDescription($description); + $series->save(); - $data = [ - 'data' => [ - 'id' => $series->getId(), - 'name' => $series->getName(), - 'description' => $series->getDescription(), - ], - ]; + $data = [ + 'data' => [ + 'id' => $series->getId(), + 'name' => $series->getName(), + 'description' => $series->getDescription(), + ], + ]; - return $response->withJson($data); -}); + return $response->withJson($data); + }); -// Run app -$app->run(); + // Run app + $app->run(); // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // End of very very very basic auth // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -else: -http_response_code(401); - -endif; +} else { + http_response_code(401); +} diff --git a/public/old/createEvent.php b/public/old/createEvent.php index 0ed4b2d..a833be0 100755 --- a/public/old/createEvent.php +++ b/public/old/createEvent.php @@ -543,38 +543,38 @@ } $groups = GroupQuery::create()->joinWith('Group.Role')->joinWith('Role.UserRole')->find(); - foreach ($groups as $group): ?> + foreach ($groups as $group) { ?> getName() ?> - getRoles() as $role): ?> + getRoles() as $role) { ?>
- + - + - +
- +
- 0): ?> - + 0) { ?> +
- - + +
diff --git a/public/old/emailGroup.php b/public/old/emailGroup.php index 58eee33..bb5199d 100644 --- a/public/old/emailGroup.php +++ b/public/old/emailGroup.php @@ -110,13 +110,13 @@

Send to

- 0): ?> - + 0) { ?> +
- - + +
diff --git a/public/old/includes/footer.php b/public/old/includes/footer.php index 621c8d9..9fa5ab2 100755 --- a/public/old/includes/footer.php +++ b/public/old/includes/footer.php @@ -21,7 +21,7 @@ along with Church Rota. If not, see . */ -?> +?>
@@ -118,9 +118,11 @@ - + - + seen == false) { $unseen += 1; } - } - ?> + } ?>
  • @@ -357,7 +356,7 @@ */ - if (isset($_SESSION['userid'])): ?> + if (isset($_SESSION['userid'])) { ?> - +
  • @@ -486,11 +485,11 @@
  • > View All
  • - +
  • > Add Event
  • - + > Settings - +
  • >Login
  • - + diff --git a/public/old/license.php b/public/old/license.php index b024522..389e310 100755 --- a/public/old/license.php +++ b/public/old/license.php @@ -22,7 +22,7 @@ You should have received a copy of the GNU General Public License along with Church Rota. If not, see . */ -include 'includes/header.php'; ?> +include 'includes/header.php'; ?>

    License

                        GNU GENERAL PUBLIC LICENSE
    diff --git a/public/old/linkSocialAuth.php b/public/old/linkSocialAuth.php index c97c2dc..ac5face 100644 --- a/public/old/linkSocialAuth.php +++ b/public/old/linkSocialAuth.php @@ -88,37 +88,37 @@
    - +

    Social login has not been enabled.

    Speak with your site administrator if you think this feature should be enabled.

    - + - +

    - +
    - +
    - +
    - +

    - +
    @@ -116,9 +116,9 @@ '.$sentSuccess.'
    '; - endif; + } ?> diff --git a/public/old/pendingAccounts.php b/public/old/pendingAccounts.php index c5f4524..e866c0f 100644 --- a/public/old/pendingAccounts.php +++ b/public/old/pendingAccounts.php @@ -102,7 +102,7 @@

    Source: source ?>

    - + - + - +

    Merge with existing user

    @@ -132,9 +132,9 @@
    @@ -143,6 +143,6 @@ - + diff --git a/public/old/plugins/ckeditor/samples/old/assets/posteddata.php b/public/old/plugins/ckeditor/samples/old/assets/posteddata.php index 2d7e01f..dfb57de 100755 --- a/public/old/plugins/ckeditor/samples/old/assets/posteddata.php +++ b/public/old/plugins/ckeditor/samples/old/assets/posteddata.php @@ -4,7 +4,7 @@ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ -?> +?> @@ -35,7 +35,7 @@ $value = htmlspecialchars(stripslashes((string) $value)); } else { $value = htmlspecialchars((string) $value); - } ?> + } ?>
    @@ -43,7 +43,7 @@ +?> - +

    Error

    - +

    Add Series:

    diff --git a/public/old/settings.php b/public/old/settings.php index feaf241..ce0fbcf 100755 --- a/public/old/settings.php +++ b/public/old/settings.php @@ -342,21 +342,21 @@
    diff --git a/public/old/swap.php b/public/old/swap.php index dfd5338..18923b4 100644 --- a/public/old/swap.php +++ b/public/old/swap.php @@ -165,15 +165,15 @@
    + if (isset($message)) { ?>

    - +

    Error:

    - + getId()); $canDeclineSwap = canDeclineSwap($swap->getId()); @@ -198,21 +198,21 @@

    This swap is awaiting approval

    ' : '' ?>
    - + - + - 0): ?> + 0) { ?> - +
    @@ -248,11 +248,11 @@
    - + - 0): ?> + 0) { ?> - +
    @@ -271,16 +271,16 @@
    - + - +

    There are no roles in the event you are skilled to cover.

    If you need adding to the rota, speak to an admin.

    - + diff --git a/public/old/swaps.php b/public/old/swaps.php index 9426c8d..aca9d19 100644 --- a/public/old/swaps.php +++ b/public/old/swaps.php @@ -79,7 +79,7 @@
    - + getEventPerson()->getEvent() ?>
    @@ -105,20 +105,20 @@ $canAcceptSwap = canAcceptSwap($swap->getId()); $canDeclineSwap = canDeclineSwap($swap->getId()); ?> - + - +
    - +
    diff --git a/public/plugins/ckeditor/samples/old/assets/posteddata.php b/public/plugins/ckeditor/samples/old/assets/posteddata.php index 2d7e01f..dfb57de 100755 --- a/public/plugins/ckeditor/samples/old/assets/posteddata.php +++ b/public/plugins/ckeditor/samples/old/assets/posteddata.php @@ -4,7 +4,7 @@ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ -?> +?> @@ -35,7 +35,7 @@ $value = htmlspecialchars(stripslashes((string) $value)); } else { $value = htmlspecialchars((string) $value); - } ?> + } ?>
    @@ -43,7 +43,7 @@ +?>