Opened 18 years ago
Closed 2 years ago
#4116 closed defect (bug) (worksforme)
wp_texturize to defect certain links in comments and on page
Reported by: | h4x3d | Owned by: | Nazgul |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.2.1 |
Component: | Formatting | Keywords: | needs-patch has-unit-tests wptexturize bulk-reopened close |
Focuses: | Cc: |
Description
the wp_texturize() function in formatting.php (includes) of wordpress breaks links of the domain format (number)x(number).
For example, a comment left by a domain such as www.h4x3d.com, which includes the (4)x(3) in the domain name, renders to www.xn--h43d-rma.com. This breaks the link.
It does occur on the page, but also with in the page comments.
It does also occur when the text with the special combination is not a link, but plain text.
Attachments (7)
Change History (56)
#1
@
18 years ago
- Keywords has-patch added
This is caused by make_clickable being run after wp_texturize.
If you switch those around the link text still gets changed, but the link href works.
Attached patch does just that.
#3
@
18 years ago
Glad someone figured this out. It is one of those bugs that has been a nightmare. It was reported on #3777 also.
#4
@
18 years ago
- Keywords commit added
- Owner changed from anonymous to rob1n
Looks good to me, as well.
#5
follow-up:
↓ 6
@
18 years ago
- Keywords commit removed
I could reproduce this on a trunk install, but the patch didn't fix it.
#6
in reply to:
↑ 5
@
18 years ago
Replying to rob1n:
I could reproduce this on a trunk install, but the patch didn't fix it.
What input did you use? I tried all the cases I could think of and got all working links with my patch.
Just curious what I missed.
#7
@
18 years ago
I put http://www.h4x3d.com/ (just text) in a comment, but it didn't turn out quite like what the description says. It was messed up, just that http://www.h4 and then the x was a multiplication sign, and the rest text.
I tried switching the priority to 9, but still nothing. I'll try again.
#10
in reply to:
↑ description
@
18 years ago
thanks for all your efforts!
#11
@
18 years ago
- Priority changed from normal to high
- Resolution fixed deleted
- Severity changed from minor to normal
- Status changed from closed to reopened
- Version changed from 2.1.3 to 2.2
I was just trying out the 2.2er version of wordpress on my website (h4x3d.com) and found out that some instances (see attached image (50kb) or source code of http://wordpress.h4x3d.com)of 4x3 are turned into × which breaks the link to the style-sheet and so on.
I assume this is connected to the wp_texturize function. Can anyone help me?
I have set-up a test-install of wordpress 2.2 on http://wordpress.h4x3d.com
#12
in reply to:
↑ description
@
18 years ago
- Status changed from reopened to new
(4)x(3) in the domain name renders to www.h4×3d.com. This breaks the link.
not sure which breakage I prefer, the wordpress 2.1 xn-rma break or this ×...
#13
@
18 years ago
Try removing the , '/(\d+)x(\d+)/' and , '$1×$2' parts from the $dynamic_characters= and $dynamic_replacements= lines in the wp_texturize function.
#15
in reply to:
↑ 14
@
18 years ago
Replying to Nazgul:
works like a charm nazgul. removed it from /wp-includes/formatting.php
is this likely to get fixed in a future release of wordpress?
thank a lot for your help already!
#16
@
18 years ago
I put it to work on http://themes.h4x3d.com and left http://wordpress.h4x3d.com unfixed for later review (if anyone needs to check the defect)
#19
follow-up:
↓ 22
@
18 years ago
Replying to h4x3d:
Replying to Nazgul:
works like a charm nazgul. removed it from /wp-includes/formatting.php
is this likely to get fixed in a future release of wordpress?
thank a lot for your help already!
I did some further testing. The code is there for a reason, it makes certain types of text look pretty, but it shouldn't be used on (part of) links. Therefore it seems theme related.
Could you attach the header.php from your theme here, so I can do some further testing?
I'm also lowering the priority, because you have a working workaround and not a lot of people are affected by this.
#20
@
18 years ago
- Priority changed from high to normal
Duh... I actually have to change the priority. Just typing about it doesn't make it happen. ;)
#21
@
18 years ago
sure thing nazgul,
but I think it is theme UNrelated, as it appears to happen even with the default wordpress theme. the link to the stylesheet is broken due to the 4x3 in the domain name and the filter changing it from the actual 4x3 into some fancy ascii multiply-sign which breaks it.
#22
in reply to:
↑ 19
@
18 years ago
I uploaded the files as you wanted and added some more description in my posts above, how can I help additionally?
#23
@
18 years ago
- Keywords has-patch added
- Owner changed from rob1n to Nazgul
- Status changed from new to assigned
It took me a lot longer to track this bug down than I'd thought.
There is a bug which was introduced in changeset [4983], which causes all thing passed to bloginfo to be wptexturized, instead of just the non-url ones.
I've attached a patch which fixes this.
#26
@
17 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
I think it make more sense if the pattern look something like this: /(\d+)x(\d+[\w])/ in place of /(\d+)x(\d+)/
because a 23x23 is math but a url like http://www.youtube.com/watch?v=irWR7F0x2uU isn't.
maybe there are better solution but this pattern broke some video/youtube plugins because the url looks like ..?v=irWR7F0×2uU wich a flashplayer didn't unterstand.
#28
@
17 years ago
You know what? We've burnt a lot of cycles on this over the years. Poor h4x3d is always getting screwed by this. Why don't we just axe it adn leave mathematical forumas up to plugins?
#29
@
17 years ago
+1 to that. I don't see that converting number x number into number × number is particularly useful anyway.
#36
@
15 years ago
- Keywords needs-unit-tests added
Another long-player in the formatting bug league, +1 for getting a
definition, unit-tests and merging with related ones.
Versus: #3833
#39
@
14 years ago
- Cc norbert@… added
Both math and URLs containing (number)x(number) will be fixed by #4539. Submitting unit tests there together with a bunch of other tests for the same ticket.
#41
@
11 years ago
This was mostly resolved in [14144]
It would still be a problem where a domain name begins or ends with the 9x9 phrase.
#47
@
6 years ago
- Keywords bulk-reopened added
This is still a problem.
I had to use
add_filter( 'no_texturize_shortcodes', 'shortcodes_to_exempt_from_wptexturize' );
because urls like http://xyz-300x200.jpg were being converted to http://xyz-300×200.jpg
#48
@
2 years ago
Tested now with 6.2 alpha, in a post content and in a comment with http://xyz-300×200.jpg
.
The HTML generated in comment is <p><a href="http://xyz-300x200.jpg">http://xyz-300×200.jpg</a></p>
, so just sanitize the content but not the URL.
To me this ticket can be closed.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
2 years ago
#51
@
2 years ago
- Resolution set to worksforme
- Status changed from reopened to closed
As per the last old tickets triage session, it appears thats the issue can be reproduced anymore.
Closing this as worksforme
.
Feel free to reopen the ticket and to share reproduction steps if you find a way to reproduce the issue :)
graphic showing the error (wp_texturize)