From 2b4fc354dba7e176624dc0a3f6487404a8737dda Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 29 Mar 2020 09:05:04 +0200 Subject: [PATCH 1/6] Fixed query in migration for postgres --- data/migrations/Version20200323190014.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/data/migrations/Version20200323190014.php b/data/migrations/Version20200323190014.php index fe3c340d..47cf402a 100644 --- a/data/migrations/Version20200323190014.php +++ b/data/migrations/Version20200323190014.php @@ -22,15 +22,16 @@ final class Version20200323190014 extends AbstractMigration { $qb = $this->connection->createQueryBuilder(); $qb->update('visit_locations') - ->set('is_empty', true) - ->where($qb->expr()->eq('country_code', ':empty')) - ->andWhere($qb->expr()->eq('country_name', ':empty')) - ->andWhere($qb->expr()->eq('region_name', ':empty')) - ->andWhere($qb->expr()->eq('city_name', ':empty')) - ->andWhere($qb->expr()->eq('timezone', ':empty')) + ->set('is_empty', ':isEmpty') + ->where($qb->expr()->eq('country_code', ':emptyString')) + ->andWhere($qb->expr()->eq('country_name', ':emptyString')) + ->andWhere($qb->expr()->eq('region_name', ':emptyString')) + ->andWhere($qb->expr()->eq('city_name', ':emptyString')) + ->andWhere($qb->expr()->eq('timezone', ':emptyString')) ->andWhere($qb->expr()->eq('lat', 0)) ->andWhere($qb->expr()->eq('lon', 0)) - ->setParameter('empty', '') + ->setParameter('isEmpty', true) + ->setParameter('emptyString', '') ->execute(); } From af61fdb52d032974c4603431a38c66a95c3fb181 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 29 Mar 2020 12:15:52 +0200 Subject: [PATCH 2/6] Updated changelog --- CHANGELOG.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe4fcaa8..ced9a5eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). +## [Unreleased] + +#### Added + +* *Nothing* + +#### Changed + +* *Nothing* + +#### Deprecated + +* *Nothing* + +#### Removed + +* *Nothing* + +#### Fixed + +* [#700](https://github.com/shlinkio/shlink/issues/700) Fixed migration not working with postgres. + + ## 2.1.1 - 2020-03-28 #### Added From 11879ea37723a66acf708c4c0610810287303bd1 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 29 Mar 2020 12:51:39 +0200 Subject: [PATCH 3/6] Ensured tags are not sluggified when using them to filter short URL lists --- module/Core/src/Validation/ShortUrlsParamsInputFilter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/Core/src/Validation/ShortUrlsParamsInputFilter.php b/module/Core/src/Validation/ShortUrlsParamsInputFilter.php index b3e6db2d..20191fa1 100644 --- a/module/Core/src/Validation/ShortUrlsParamsInputFilter.php +++ b/module/Core/src/Validation/ShortUrlsParamsInputFilter.php @@ -39,7 +39,7 @@ class ShortUrlsParamsInputFilter extends InputFilter $tags = $this->createArrayInput(self::TAGS, false); $tags->getFilterChain()->attach(new Filter\StringToLower()) - ->attach(new Validation\SluggerFilter()); + ->attach(new Filter\PregReplace(['pattern' => '/ /', 'replacement' => '-'])); $this->add($tags); } } From e790a38ceabd507d9edeee7108ceb79f45f6b01b Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 29 Mar 2020 12:54:09 +0200 Subject: [PATCH 4/6] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ced9a5eb..2e2e6311 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this #### Fixed * [#700](https://github.com/shlinkio/shlink/issues/700) Fixed migration not working with postgres. +* [#690](https://github.com/shlinkio/shlink/issues/690) Fixed tags being incorrectly sluggified when filtering short URL lists, making results not be the expected. ## 2.1.1 - 2020-03-28 From c6602a81abb5194ed77538fd964ad6c5e4e2d959 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 29 Mar 2020 13:07:27 +0200 Subject: [PATCH 5/6] Updated to infection 0.16 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 9cadd738..7094757d 100644 --- a/composer.json +++ b/composer.json @@ -63,8 +63,8 @@ "devster/ubench": "^2.0", "dms/phpunit-arraysubset-asserts": "^0.2.0", "eaglewu/swoole-ide-helper": "dev-master", - "infection/infection": "^0.15.0", - "phpstan/phpstan": "^0.12.3", + "infection/infection": "^0.16.1", + "phpstan/phpstan": "^0.12.18", "phpunit/phpunit": "^9.0.1", "roave/security-advisories": "dev-master", "shlinkio/php-coding-standard": "~2.1.0", @@ -135,7 +135,7 @@ "test:api:ci": "@test:api --coverage-php build/coverage-api.cov", "test:unit:pretty": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-html build/coverage", "infect": "infection --threads=4 --min-msi=80 --log-verbosity=default --only-covered", - "infect:ci": "@infect --coverage=build", + "infect:ci": "@infect --coverage=build --skip-initial-tests", "infect:show": "@infect --show-mutations", "infect:test": [ "@test:unit:ci", From 1ca50a4a8af5db444f53e188774d2c203ca5d9b9 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 29 Mar 2020 13:08:21 +0200 Subject: [PATCH 6/6] Updated changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e2e6311..9e7d5ea1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). -## [Unreleased] +## 2.1.2 - 2020-03-29 #### Added @@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this #### Changed -* *Nothing* +* [#696](https://github.com/shlinkio/shlink/issues/696) Updated to infection v0.16. #### Deprecated