From 30e4ddb950ecdfc5118c6019e7a22f9d256ce535 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 20 Oct 2019 09:42:46 +0200 Subject: [PATCH 1/3] Updated to latest infection version --- composer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index b7223999..838df503 100644 --- a/composer.json +++ b/composer.json @@ -60,8 +60,8 @@ "devster/ubench": "^2.0", "eaglewu/swoole-ide-helper": "dev-master", "filp/whoops": "^2.4", - "infection/infection": "^0.13.4", - "phpstan/phpstan": "^0.11.2", + "infection/infection": "^0.14.2", + "phpstan/phpstan": "^0.11.16", "phpunit/phpcov": "^6.0", "phpunit/phpunit": "^8.3", "roave/security-advisories": "dev-master", @@ -151,7 +151,6 @@ ] }, "scripts-descriptions": { - "check": "Alias for \"cs\", \"stan\", \"test\" and \"infect\"", "ci": "Alias for \"cs\", \"stan\", \"test:ci\" and \"infect:ci\"", "cs": "Checks coding styles", "cs:fix": "Fixes coding styles, when possible", From b8cdc29d8f71d7ea0cfd994cfa080e2d9ffb5c3b Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 20 Oct 2019 09:53:11 +0200 Subject: [PATCH 2/3] Increased long URL size in DB to 2048 characters --- data/migrations/Version20191020074522.php | 37 +++++++++++++++++++ data/migrations_template.txt | 1 + docker-compose.yml | 1 + .../Shlinkio.Shlink.Core.Entity.ShortUrl.php | 2 +- 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 data/migrations/Version20191020074522.php diff --git a/data/migrations/Version20191020074522.php b/data/migrations/Version20191020074522.php new file mode 100644 index 00000000..baf1ce7a --- /dev/null +++ b/data/migrations/Version20191020074522.php @@ -0,0 +1,37 @@ +getOriginalUrlColumn($schema)->setLength(2048); + } + + /** + * @throws SchemaException + */ + public function down(Schema $schema): void + { + $this->getOriginalUrlColumn($schema)->setLength(1024); + } + + /** + * @throws SchemaException + */ + private function getOriginalUrlColumn(Schema $schema): Column + { + return $schema->getTable('short_urls')->getColumn('original_url'); + } +} diff --git a/data/migrations_template.txt b/data/migrations_template.txt index 2e3e1edb..c7b938f2 100644 --- a/data/migrations_template.txt +++ b/data/migrations_template.txt @@ -1,4 +1,5 @@ ; diff --git a/docker-compose.yml b/docker-compose.yml index 34b9c64e..630ab955 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -78,6 +78,7 @@ services: environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: shlink + MYSQL_INITDB_SKIP_TZINFO: 1 shlink_redis: container_name: shlink_redis diff --git a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.ShortUrl.php b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.ShortUrl.php index 8dd6dc49..76e5ae7b 100644 --- a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.ShortUrl.php +++ b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.ShortUrl.php @@ -24,7 +24,7 @@ $builder->createField('id', Type::BIGINT) $builder->createField('longUrl', Type::STRING) ->columnName('original_url') - ->length(1024) + ->length(2048) ->build(); $builder->createField('shortCode', Type::STRING) From 67958a78d3ae948e13059d9a0d4b49e4adf27795 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 20 Oct 2019 09:55:00 +0200 Subject: [PATCH 3/3] Updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cda60fac..84dfd5f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this #### Fixed -* *Nothing* +* [#507](https://github.com/shlinkio/shlink/issues/507) Fixed error with too long original URLs by increasing size to the maximum value (2048) based on [the standard](https://stackoverflow.com/a/417184). ## 1.19.0 - 2019-10-05