Opened 8 years ago
Last modified 12 months ago
#37758 new defect (bug)
The Link Checker tool does not detect some links
Reported by: | Djibs13 | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | Editor | Keywords: | good-first-bug has-patch |
Focuses: | administration | Cc: |
Description
hello,
The Link Checker tool in WordPress 4.6 doesn’t detect an error when you put something before ‘http(s)‘. Example: xhttps://www.google.com
And the tool does not detect error if a missing letter in "http".
examples :
ttps://core.trac.wordpress.org/newticket
htps://core.trac.wordpress.org/newticket
htts://core.trac.wordpress.org/newticket
Attachments (1)
Change History (14)
#3
@
8 years ago
Right. In order to not flag all the various URI schemes, it only checks links that start with http
. Note that there is another small piece of regex in both link dialogs that prepends http://
to URIs that do not look like local.
On the other hand this can be changed to trigger on anything other than /^(https?|ftp|mailto):|^\//i
as these uncommon schemes are probably used very very rarely.
This ticket was mentioned in PR #2308 on WordPress/wordpress-develop by aleksganev.
3 years ago
#6
- Keywords has-patch added; needs-patch removed
Fixes to the link validation in the TinyMCE editor.
The Link Checker tool in did not correctly validate the Protocol in the links, allowing anything to be written before the ":" part of the link without displaying it as invalid (e.g. _qwerty://www.google.com_).
The validation should now mark as invalid anything that is not a _http(s):_, _mailto:_ or _ftp://_ link.
Trac ticket: https://core.trac.wordpress.org/ticket/37758
#7
@
3 years ago
Hey guys, this is my first patch, so I hope I did everything correctly.
I used @azaozz's suggestion and made the validation mark as invalid everything except http(s), mailto and ftp links. I reused the email check which was already in the file, added a new test that checks for "ftp:" in the beginning of the link and modified the link check, so that it allows only valid http and https urls. If all 3 of the tests fail, the string will be marked as invalid.
@aleks7391 commented on PR #2308:
19 months ago
#8
PR Looks fine.
the line -
if ( ! isLink && ! isEmail && ! isFtp )
is more readable if written this way
if ( ! ( isLink || isEmail || isFtp ) )
@atiqsu Updated that line as suggested. Please take another look.
Commit - 2ae8cf8
#9
@
13 months ago
Test
The pull request https://github.com/WordPress/wordpress-develop/pull/2308
This RR is the classic editor-based fix.
Not for GB
WP version: trunk
PHP version: 8.2
❌ This PR downgrades the WordPress version. This means, after checkout to this PR, WordPress goes to 6.3
For more clarification, I captured this video https://www.loom.com/share/619cc8af80be4c9e88a0f8612ac3f4ae?sid=a9d7c6ce-39d9-4e72-9a81-38885ad833f4
And finally, the post editor is blank.
So, for the GB fix, I added the need-patch
keyword.
This ticket was mentioned in Slack in #core by mrinal. View the logs.
13 months ago
#12
@
13 months ago
We must create an issue on the Gutenberg repository to fix this in the LinkControl block.
EDIT
I reported an issue on the Gutenberg repository #53938 that pertains to the same matter.
#13
@
12 months ago
- Keywords has-patch added; needs-patch removed
So we have a patch for classic editor attached here ( PR for #37758 )
And for Gutenberg a uptream ticket here: #GB47414
Can we switch this ticket has-patch and push the classic editor patch forward? Or need both editors to be fixed at same time?
Confirmed. You can enter most kinds of stupidity and it will not fire.
Related: #36638, code to find in [38159]
@azaozz