WordPress.org

Support

Support » Requests and Feedback » Possible Broken Post Name Check?

Possible Broken Post Name Check?

  • I have a plugin that uses wp_insert_post to add posts to the database.

    wp_insert_post is attempting to get the post_name by sanitizing the post_title and adding hyphens.

    Fine, although it removes slashes (which I nicely put in) with stripslashes and relies on the new insert function to use add_magic_quotes to put them back.

    That is all fine and good, but wp_insert_post actually uses the post_name in a query before it ever gets to the insert function. The post_name_check part of wp_insert_post, to be precise.

    What does this mean?

    When a post title has a dodgy character, for example the apostrophe ‘ in Can’t, it doesn’t like it one bit, and hangs at post_name_check.

Viewing 1 replies (of 1 total)
  • if it were broken, it would break when posting normally too right?

    maybe you just need to find out what the act of posting normally sends to this function, and feed it the same thing. If it needs to be escaped or encoded in some way, just do what wp’s doing.

    I’m just talking out of my arse here, but that seems logical, right?

Viewing 1 replies (of 1 total)
  • The topic ‘Possible Broken Post Name Check?’ is closed to new replies.
Skip to toolbar