and it outputs something like this:
????????????????…
HOW TO FIX:
Open /wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/includes/settings-page.php
FIND:
$fb_desc=(intval($fb_desc_chars)>0 ? substr(esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))),0,$fb_desc_chars) : esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))));
Replace to:
$fb_desc=(intval($fb_desc_chars)>0 ? mb_substr(esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))),0,$fb_desc_chars, 'UTF-8') : esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))));
FIND:
$fb_desc=(intval($fb_desc_chars)>0 ? substr(esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))),0,$fb_desc_chars) : esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))));
Replace to:
$fb_desc=(intval($fb_desc_chars)>0 ? mb_substr(esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))),0,$fb_desc_chars, 'UTF-8') : esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))));
Please fix on next version, many thank.
jaideejung007
https://www.ads-software.com/plugins/wonderm00ns-simple-facebook-open-graph-tags/
]]>Thanks for your plugin. It helps a lot and I just found that there is a little problem:
in the line with this code to display the Custom Message,
because
htmlentities(substr($v['message'],0,32))
will break Chinese word/unstable, so a universal method is better with
htmlspecialchars(mb_substr($v['message'],0,32))
also because substr()
does not support multi-byte character, so
mb_string()
is preferred. I think it is good for plugin will probably be used in worldwide.
Hope this can help to improve it.
https://www.ads-software.com/plugins/bainternet-posts-creation-limits/
]]>On some posts (written in Icelandic) I’ve noticed that the meta description is missing.
This happens on wp 3.6.1 with plugin version 2.0.7.
I’m not sure what exactly triggers this, but I managed to solve it by replacing this line:
$description = str_replace( "\r\n", ' ' , substr( strip_tags( strip_shortcodes( $post->post_content ) ), 0, 160 ) );
with:
$charset = get_option( 'blog_charset' );
if( ! $charset )
$charset = 'UTF-8';
$wpfbogp_description = str_replace( "\r\n", ' ' , mb_substr( strip_tags( strip_shortcodes( $post->post_content ) ), 0, 160, $charset ) );
where I use mb_substr()
instead of substr()
, i.e. the multi-byte version of substr()
.
cheers
https://www.ads-software.com/plugins/wp-facebook-open-graph-protocol/
]]>Renier
Fatal error: Cannot redeclare mb_substr() (previously declared in /home/malbarvi/public_html/wp-includes/compat.php:17) in /home/malbarvi/public_html/wp-content/plugins/gravity-forms-pdf-extended/dompdf/include/functions.inc.php on line 397
https://www.ads-software.com/extend/plugins/gravity-forms-pdf-extended/
]]>https://www.ads-software.com/extend/plugins/advanced-excerpt/
]]>https://www.ads-software.com/extend/plugins/popular-widget/
]]>Have you ever read my feedback? Nothing changed in 2.9.2.
Now I am very dissatisfied.
wp_html_excerpt()
function.
Inside the function, mb_substr() is used to slice the string into given size. Just like this: $str = mb_substr( $str, 0, $count );
.
My other PHP applications also use mb_substr()
, but one thing is different: I always specify encoding parameter.
So I added the parameter: $str = mb_substr( $str, 0, $count, 'UTF-8' );
. After this, all the things are green.
I don’t know why WP developers omitted the parameter, but adding it also repairs this Permalink section underneath the title field in ‘Edit Post’ page. Usually I don’t touch WP built-in functions, but this is serious issue (because this time, unlike the permalink section in admin page, the broken characters are visible to public) and unwillingly I had to modify the function.
I hope to see this issue solved in next version.
Addition:
I found backward compatibility code from /wp-includes/compat.php. Now I see why encoding parameter got omitted. _mb_substr()
function processes only UTF-8. But I recommend to add the parameter in case of real mb_substr()
exists. Real mb_substr()
make some kind of strange behavior in some environments, as I described above.
Also, don’t forget to add the parameter on mb_strlen(), because it affects permalink abridgement on Permalink section in ‘Edit Post’ page.
First problem is the use of white spaces. WP is designed to use white spaces as word separators. WP extracts the excerpts automatically from the contents using white spaces as word delimitors. However, you know, ASIAN text doesn’t use white spaces at all. Therefore, ASIAN text archives appear like this bad example https://www25.big.jp/~jam/unix/wordpress/example-bad-excerpt.html instead of this better example https://www25.big.jp/~jam/unix/wordpress/example-good-excerpt.html.
Second problem is the difference of mb_substr and substr. Substr extracts n-bytes data. mb_substr does n-characters data. It may be equal to n*4 bytes. I don’t know the specification of RSS and others, so that I’m not sure whether “BYTES” is important or not in those specifications. I just thought it is better that you know the difference between substr and mb_substr since you started using latter. So, just letting you know it.
I made my own substr clone for ASIAN text using UTF-8 and several modification on WP 2.0.1 to use it. Those are available https://www25.big.jp/~jam/unix/wordpress/#patches to download. (Note: my own substr works well only with UTF-8. mb_substr works well with everything).
I’m not sure how to present issue/patches so I’m simply describing them here with a hope this might help WP development little. Please let me know if you need any kind of deeeper descriptions. Thanks.
]]>