WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#27827 closed defect (bug) (invalid)

Markup: Title with markup shows html markup when page attributes -> parent pages is being selected

Reported by: manojhl123 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8.3
Component: General Keywords:
Focuses: administration Cc:

Description

Well title itself describes every thing.

when setting parent page i observed that Title with markup shows html.
This is ugly and must be escaped with html strip_tags()

Attachments (3)

sample.png (6.1 KB) - added by manojhl123 6 years ago.
This file shows the error
sample.2.png (12.2 KB) - added by manojhl123 6 years ago.
Another edge case, the walker must ensure that at certain cases HTML stripped title must be displayed
Untitled-1.png (83.5 KB) - added by manojhl123 6 years ago.

Download all attachments as: .zip

Change History (17)

@manojhl123
6 years ago

This file shows the error

#1 @manojhl123
6 years ago

  • Keywords needs-patch added

#2 @manojhl123
6 years ago

  • Keywords has-patch added; needs-patch removed
  • Resolution set to invalid
  • Status changed from new to closed
class Walker_PageDropdown

on file post-template.php at line 1143 where post_title is html escaped..
I think instead of esc_html - strip_tags must be applied

Version 0, edited 6 years ago by manojhl123 (next)

#3 follow-up: @ocean90
6 years ago

  • Keywords has-patch removed
  • Milestone Awaiting Review deleted

Not sure why you have closed it as invalid, but yes, it's invalid.

You have chosen to include HTML in your title, so the title display should include the HTML. The posts list shows the title also HTML escaped.

#4 @manojhl123
6 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

#5 follow-up: @nacin
6 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed

@manojhl123
6 years ago

Another edge case, the walker must ensure that at certain cases HTML stripped title must be displayed

#6 in reply to: ↑ 5 @manojhl123
6 years ago

Replying to nacin:
i don't know why it is ticket is invalid!!!!

#7 @manojhl123
6 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

#8 in reply to: ↑ 3 @manojhl123
6 years ago

Replying to ocean90:

Not sure why you have closed it as invalid, but yes, it's invalid.

You have chosen to include HTML in your title, so the title display should include the HTML. The posts list shows the title also HTML escaped.

Yes I have chosen to have HTML tags in Post Title, not in nav menu, page atributes or other cases where it makes no sense, HTML tags in post title are used to make a semantic meaning for title or do some styling it is frontend purpose, but in dropdown_pages it makes no sense since neither semantic meaning nor style is required there. only the title of the post is significant in this case.

Am i right!!!!!!!!!??

#9 @nacin
6 years ago

  • Milestone set to Awaiting Review

#10 follow-up: @5um17
6 years ago

Title mean to be have plain text. If someone uses it as textarea to display HTML then there is no difference between title field and content editor.

@manojhl123
6 years ago

#11 in reply to: ↑ 10 ; follow-up: @manojhl123
6 years ago

Replying to 5um17:

Title mean to be have plain text. If someone uses it as textarea to display HTML then there is no difference between title field and content editor.


To provide semantic meaning for post_title we need HTML tags so, post title needs HTML tags but not in all cases.

#12 in reply to: ↑ 11 ; follow-up: @5um17
6 years ago

Replying to manojhl123:

Replying to 5um17:

Title mean to be have plain text. If someone uses it as textarea to display HTML then there is no difference between title field and content editor.


To provide semantic meaning for post_title we need HTML tags so, post title needs HTML tags but not in all cases.

To provide semantic meaning to post title you must modify template file where it is being render instead of saving your time and modifying core. You can also use a metabox to display this code snippet on frontend and leaving title readable in dashboard.

#13 in reply to: ↑ 12 @manojhl123
6 years ago

Replying to 5um17:

Replying to manojhl123:

Replying to 5um17:

Title mean to be have plain text. If someone uses it as textarea to display HTML then there is no difference between title field and content editor.


To provide semantic meaning for post_title we need HTML tags so, post title needs HTML tags but not in all cases.

To provide semantic meaning to post title you must modify template file where it is being render instead of saving your time and modifying core. You can also use a metabox to display this code snippet on frontend and leaving title readable in dashboard.

Using HTML tags (not all) in post title is provided form core itself, if you ever tested your theme with theme-unit-test data, a post is their with <strong> and <em> tags in post title. The reason for using this to provide semantic meaning in post titles too and helps a bit in SEO(little much, using semantics helps a lot in SEO)..

Inside admin panel you don't need to provide the semantic meaning for anything because it will not be exposed to world. so what I am asking is strip these HTML tags inside Admin panel and allow these tags in front-end....

#14 @DrewAPicture
6 years ago

  • Focuses administration added
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from reopened to closed

Hi manojhl123,

This ticket has been closed as invalid by a lead developer, core committer, and now me. Feel free to continue the discussion if you wish to, but please do not reopen the ticket.

Note: See TracTickets for help on using tickets.