Bug #52912

Link validator does not check links in input fields

Added by Dmitry Dulepov about 7 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Linkvalidator
Target version:
-
Start date:
2013-10-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Linkvalidator ignores external links in input fields. One example is "External url" page type and its "url" field: it is ignored during the check.

This is reproducible with any field that is filled by the TYPO3 link wizard and has prety standard configuration:

        'path' => array(
            'exclude' => 1,
            'label' => 'LLL:EXT:....',
            'config' => array(
                'type'     => 'input',
                'size'     => '48',
                'max'      => '255',
                'eval'     => 'required,trim',
                'wizards'  => array(
                    '_PADDING' => 2,
                    'link'     => array(
                        'type'         => 'popup',
                        'title'        => 'Link',
                        'icon'         => 'link_popup.gif',
                        'script'       => 'browse_links.php?mode=wizard',
                        'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
                    )
                ),
                'softref'  => 'typolink,typolink_tag,images,email[subst],url'
            )
        ),
There are two problems that cause the issue:
  1. TYPO3 link wizard creates external links without scheme portion. TYPO3 softref parse makes such links of type "string", which linkvalidator does not recognize. To detect the type proper;y as "external", linkvalidator should preprocess 'url' softrefs and prepend the scheme.
  2. Linkvalidator processes URLs only if there is a 'subst' entry in the result of the softparser. This will be true for some typolinks and for 'email[subst]' but not for 'url' declaration. Thus any external URL is ignored.

The problem is reproducible with linkvalidator in TYPO3 4.7 and TYPO3 6.2 beta 1.


Files

52912.diff (998 Bytes) 52912.diff Dmitry Dulepov, 2013-10-17 12:59

Related issues

Related to TYPO3 Core - Feature #89177: Change TsConfig Defaults of Linkvalidator and Enable all core fields containing linksNew2019-09-15

Actions
Related to TYPO3 Core - Bug #89265: Linkvalidator: URLs in RTE fields are not checkedClosed2019-09-25

Actions
#1

Updated by Dmitry Dulepov about 7 years ago

Added a patch. Not sure if this is 100% right solution (more like a workaround) but it works for me.

#2

Updated by Michael Stucki almost 7 years ago

  • Category set to Linkvalidator
#3

Updated by Michael Stucki almost 7 years ago

  • Project changed from Linkvalidator to TYPO3 Core
  • Category changed from Linkvalidator to Linkvalidator
#4

Updated by Mathias Schreiber almost 6 years ago

  • Target version set to 7.4 (Backend)
  • Is Regression set to No
#5

Updated by Susanne Moog over 5 years ago

  • Target version changed from 7.4 (Backend) to 7.5
#6

Updated by Benni Mack about 5 years ago

  • Target version deleted (7.5)
#7

Updated by Lina Ourima about 1 year ago

  • TYPO3 Version changed from 6.2 to 8

I can reproduce this problem in TYPO3 8.7.27 as follows by using the configuration from the manual:

mod.linkvalidator {
searchFields {
pages = media,url
}
}

create a page as external link and let it point to a site that produces a 404. No error is being found.

So I debugged:
function "checkLink" in class ExternalLinktype is not being called for that link. In function analyzeRecord of Class LinkAnalyzer Line 292 the $resultArray is null and we drop out of the function without checking the link.

I would suggest to mention in the manual that this isnt working. And put working examples of configuration in the manual.

#8

Updated by Lina Ourima about 1 year ago

  • TYPO3 Version changed from 8 to 10

I just reproduced this in 10.1.0-dev

#9

Updated by Gerrit Code Review about 1 year ago

  • Status changed from New to Under Review

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

#10

Updated by Gerrit Code Review about 1 year ago

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

#11

Updated by Gerrit Code Review about 1 year ago

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

#12

Updated by Gerrit Code Review about 1 year ago

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

#13

Updated by Lina Ourima about 1 year ago

  • Related to Feature #89177: Change TsConfig Defaults of Linkvalidator and Enable all core fields containing links added
#14

Updated by Sybille Peters about 1 year ago

  • Related to Bug #89265: Linkvalidator: URLs in RTE fields are not checked added
#15

Updated by Gerrit Code Review about 1 year ago

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/+/61821

#16

Updated by Anonymous about 1 year ago

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

Updated by Gerrit Code Review about 1 year ago

  • Status changed from Resolved to Under Review

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/+/61903

#18

Updated by Tobi Kretschmann about 1 year ago

  • Status changed from Under Review to Resolved
#19

Updated by Benni Mack 11 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF