#3150 closed defect (bug) (fixed)
'link to page' attachment permalink incorrect, if using a relative WordPress URL starting with '/'
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | normal | Version: | 2.0.4 |
Component: | Administration | Keywords: | attachment, link to page, relative URL, 2nd-opinion, has-patch |
Focuses: | Cc: |
Description ¶
[version 2.04]
Under Options -> General, if set the WordPress address URL to a relative path beginning with a slash, (e.g., "/wordpress-2.04"), then "link to page" style attachment URLs are re-written incorrectly.
For example, this is what is inserted into the editor buffer for a link to page attachment:
<a id="p13" rel="attachment" href="wordpress-2.04/2006/09/20/test3/ts4/" title="ts4">ts4</a>
The href is missing the needed leading "/", however. Correct is:
a id="p13" rel="attachment" href="/wordpress-2.04/2006/09/20/test3/ts4/" title="ts4">ts4</a>
Possible Fix:
It appears that the fix is extremely simple: on line 120 of
wp-includes/template-functions-links.php change 'trim' to 'rtrim'.
Pull Requests
- Loading…
Change History (6)
#1
@
19 years ago
- Keywords 2nd-opinion has-patch added
- Milestone set to 2.1
- Summary changed from 'link to page' attachment permalink incorrect, if using a relative WordPress URL to 'link to page' attachment permalink incorrect, if using a relative WordPress URL starting with '/'
Note: See
TracTickets for help on using
tickets.
Attached patch of trunk based on zjohnjohnz well written bug and proposed fix above.