excerpt in characters

I used this code in one of my last projects: function ng_get_excerpt( $count ){ $permalink = get_permalink( $post->ID ); $excerpt = get_the_content(); $excerpt = strip_tags( $excerpt ); $excerpt = mb_substr( $excerpt, 0, $count ); $excerpt = mb_substr( $excerpt, 0, strripos( $excerpt, ” ” ) ); $excerpt = rtrim( $excerpt, “,.;:- _!$&#” ); $excerpt = $excerpt … Read more

Wordspress add into my javascripts

You have to either 1) take all the whitespace out of the script so WordPress does not add <p> tags and then the JS will work, or 2) disable autop in the post editor for all posts/pages (see http://codex.wordpress.org/Function_Reference/wpautop ) so WP doesn’t add paragraph breaks, or 3) do the following, which leaves autop enabled … Read more

Strange characters – despite everything being UTF-8

This is typically caused when you are copying/pasting MS Word information into the WordPress content editor. WordPress uses something called “Smart Quotes”, via a function named wptexturize(). Ideal Solution The ideal solution would be to go back through your content, and replace all single/double quotes using the keyboard. However, if you’re working with massive copy/pastes, … Read more

If a hacker changed the blog_charset to UTF-7 does that make WordPress vulnerable to further attacks?

< and > are encoded as +ADw- and +AD4- in UTF-7. Now imagine the following: Someone sends +ADw-script+AD4-alert(+ACI-Hello+ACI-)+ADw-/script+AD4- as comment text. It will pass all sanitation unescaped. The database expects and treats all incoming data as UTF-8. Since all UTF-7 streams are valid UTF-8 too, this will never result in a SQL error, and mysql_real_escape … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)