Ticket #4152 (closed defect (bug): fixed)

Opened 5 years ago

Last modified 23 months ago

posts_nav_link does not detect all html entities

Reported by: jimmyk Owned by: anonymous
Priority: low Milestone: 3.0
Component: Template Version: 2.1.3
Severity: normal Keywords: needs-patch
Cc:

Description

the nav link functions do not properly handle html entities with uppercase letters.

Attachments

entities.patch Download (1.1 KB) - added by jimmyk 5 years ago.
patch to fix bug

Change History

jimmyk5 years ago

patch to fix bug

comment:1   djr4 years ago

  • Keywords has-patch added
  • Milestone changed from 2.5 to 2.6
  • Keywords needs-patch added; has-patch removed

Funny that this did not get fixed earlier. I'll create a patch against current now.

There is a related bug, if you put the entity Ä into a post's title, template tags are not able to handle it properly.   did work for me in another test. This is defenetly broken and not an isolated Issue.

I suggest to have this closed as wontfix. The problems are overwhelming but as overwhelming as the problems are, is the data-flow in the core-design is full of deficiencies making it near impossible to fix it. Please try yourself using the following char-sequnces in the title (enter them as those into your post editor in the backend, not directly into the database);

Holla the woodfairy is pressing inside the forrest with her friends  , Ä and ä joining the party.

Additionally for those who want to test, this little snippet helped me to digg a bit into it:

	if ( !array_key_exists('htmlspecialchars', $GLOBALS['wp_filter']['the_title']) )
		add_filter('the_title', 'htmlspecialchars', 0, 1);

Versus: #4893

comment:9   ryan2 years ago

  • Milestone changed from 2.9 to 3.0

From what I can see here, none of the entities mentioned in this ticket are related to the bug at all.

The code in question appears to be to pick up invalid html entities, At present, any html entities with A-Z after the first character are wiped out.

Example: Ð will be replaced with Ð whereas ð would pass straight through as expected. Ä also passes through as expected as the capital is in the first position.

I do not see a problem with changing this to a case-insensitive regular expression.

  • Component changed from Administration to Template
  • Status changed from new to closed
  • Resolution set to fixed

(In [13922]) Handle uppercase html entities in get_next_posts_link() & get_next_comments_link() (and family) $labels. Fixes #4152

Note: See TracTickets for help on using tickets.