[wp-trac] [WordPress Trac] #46355: get_page_by_title() doesnt work if title has an apostrophe ( ‘ )
WordPress Trac
noreply at wordpress.org
Thu Mar 7 16:26:16 UTC 2019
#46355: get_page_by_title() doesnt work if title has an apostrophe ( ‘ )
-------------------------------+-------------------------
Reporter: WPnerdzz | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Posts, Post Types | Version: 2.1
Severity: normal | Resolution: worksforme
Keywords: | Focuses:
-------------------------------+-------------------------
Changes (by desrosj):
* status: new => closed
* focuses: coding-standards =>
* version: 5.1 => 2.1
* milestone: Awaiting Review =>
* keywords: needs-patch =>
* resolution: => worksforme
Comment:
Hi @WPnerdzz,
Thanks for this ticket and welcome to Trac!
I did some testing on this and I was unable to reproduce the behavior you
are describing. When I create a page with an apostrophe in the title, I am
correctly able to retrieve the page with `get_page_by_title()`.
While investigating, I noticed that `get_page_by_title()` does not have
any unit tests. I opened #46439 to add these. When I wrote the tests I and
made sure to include assertions that proves the function works as expected
when there apostrophes and quotation marks in the title.
In your examples above, the character in `Alex’s` is actually a right
single quotation mark (`U+2019`) and not an apostrophe (`U+0027`). I think
that your code may be looking for an apostrophe, but the code is actually
inserting a different character.
I am going to close this as `worksforme` because the tests show the
function is working correctly and I am unable to reproduce the issue. If
after you verify that your characters are in fact the same you are still
experiencing this issue, you can reopen this and report back with more
details.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46355#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list