Download & Extend

Replace decode_entities() with built-in html_entity_decode()

Project:Drupal core
Version:7.x-dev
Component:base system
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:Performance

Issue Summary

Follow up to #269911: Search result trimming should not fall inside HTML entities/tags.

Since PHP 5.0, html_entity_decode() supports utf8 in PHP >= 5.0, so it should be possible to use that instead of decode_entities() in Drupal 7.

Comments

#1

Status:active» needs review

Here's a first quick pass. Do we want to maintain a wrapper function?

AttachmentSizeStatusTest resultOperations
878408-entity-decode-1.patch9.09 KBIdleFAILED: [[SimpleTest]]: [MySQL] 22,778 pass(es), 8 fail(s), and 0 exception(es).View details

#2

That would be lovely. Let's see what the tests will say.

#3

Status:needs review» needs work

The last submitted patch, 878408-entity-decode-1.patch, failed testing.

#4

A the failing tests were using the exclude parameter, which the patch proposes to remove.

#5

Status:needs work» needs review

I suggest the following: keep the wrapper, as it is not trivial to get the arguments right, and rename it as drupal_html_entity_decode().

AttachmentSizeStatusTest resultOperations
878408-entity-decode.patch19.55 KBIdlePASSED: [[SimpleTest]]: [MySQL] 22,770 pass(es).View details

#6

Status:needs review» needs work

@DamZ - why break the API more than needed at this point? Let's not rename the function.

#7

Status:needs work» needs review

This is the same patch as #1 plus removing the irrelevant test case.

AttachmentSizeStatusTest resultOperations
878408-entity-decode-7.patch10.43 KBIdlePASSED: [[SimpleTest]]: [MySQL] 22,766 pass(es).View details

#8

Status:needs review» needs work

The last submitted patch, 878408-entity-decode-7.patch, failed testing.

#9

Status:needs work» needs review

huh- I find it hard to believe that's a real fail.

#10

#7: 878408-entity-decode-7.patch queued for re-testing.

#11

Status:needs review» reviewed & tested by the community

good to go.

#12

This looks good to go. I might add a "@todo: remove in Drupal 8" but I'm sure we'll remember to do that without the todo.

#13

Status:reviewed & tested by the community» fixed

Committed to CVS HEAD.

#14

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here