Bug #86921

Linkvalidator reports exception on links with tilde (~)

Added by Sybille Peters about 1 year ago. Updated 3 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Linkvalidator
Target version:
-
Start date:
2018-11-13
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Error message: Exception: NAMEPREP: Prohibited input U+0000007E

Use a link with tilde

TYPO3 version: 9-dev (master)


Related issues

Related to TYPO3 Core - Bug #85069: Linkvalidator reports links to pages with certain cookie-alerts as broken Closed 2018-05-23
Related to TYPO3 Core - Bug #80139: Tilde in base URL causes exception Closed 2017-03-04

Associated revisions

Revision 2621b322 (diff)
Added by Dmitry Dulepov 3 months ago

[BUGFIX] Make Linkvalidator accept tilde characters in links

Before, the Linkvalidator reported links with a tilde as broken. This problem
occurs because the wrong method is called from the idna_convert library.
This change fixes it by calling the proper method.

Resolves: #86921
Releases: 9.5, 8.7
Change-Id: Ie522f50e2f1fe6228c79ca6352ac5d1fad291224
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61495
Tested-by: Daniel Goerz <>
Tested-by: TYPO3com <>
Tested-by: Richard Haeser <>
Reviewed-by: Daniel Goerz <>
Reviewed-by: Richard Haeser <>

Revision 4efc4567 (diff)
Added by Dmitry Dulepov 3 months ago

[BUGFIX] Make Linkvalidator accept tilde characters in links

Before, the Linkvalidator reported links with a tilde as broken. This problem
occurs because the wrong method is called from the idna_convert library.
This change fixes it by calling the proper method.

Resolves: #86921
Releases: 9.5, 8.7
Change-Id: Ie522f50e2f1fe6228c79ca6352ac5d1fad291224
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61592
Tested-by: TYPO3com <>
Tested-by: Richard Haeser <>
Reviewed-by: Benni Mack <>
Reviewed-by: Richard Haeser <>

History

#1 Updated by Sybille Peters about 1 year ago

  • Related to Bug #85069: Linkvalidator reports links to pages with certain cookie-alerts as broken added

#2 Updated by Sybille Peters about 1 year ago

  • Related to Bug #80139: Tilde in base URL causes exception added

#3 Updated by Dmitry Dulepov 3 months ago

Following the discussion with idna_convert guys, it is linkvalidator, who calls a wrong method. Here is a patch:

--- a/typo3/sysext/linkvalidator/Classes/Linktype/ExternalLinktype.php
+++ b/typo3/sysext/linkvalidator/Classes/Linktype/ExternalLinktype.php
@@ -209,7 +209,7 @@
     protected function preprocessUrl(string $url): string
     {
         try {
-            return (new IdnaConvert())->encode($url);
+            return (new IdnaConvert())->encodeUri($url);
         } catch (\Exception $e) {
             // in case of any error, return empty url.
             $this->errorParams['errorType'] = 'exception';

#4 Updated by Gerrit Code Review 3 months ago

  • Status changed from New to Under Review

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61495

#5 Updated by Dmitry Dulepov 3 months ago

The fix is contributed by the University of Basel.

#6 Updated by Gerrit Code Review 3 months ago

Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61495

#7 Updated by Gerrit Code Review 3 months ago

Patch set 3 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61495

#8 Updated by Gerrit Code Review 3 months ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61592

#9 Updated by Dmitry Dulepov 3 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF