Search Results for 'code'
-
Search Results
-
So I’ve been digging further into the strange behavior I’ve had with slashes in posts AND with HTML tag attributes being yanked out.
It’s all related. Apparently, there is some type of problem where slashes get added TWICE when the WP intergation is on. This is why slashes start showing up everywhere and why kses fails.
I finally discovered that even though the stripslashes filter is called before bb_filter_kses, there are still slashes in front of the quotes of the attributes. So they get tossed.
So I took out all the stripslashes hacks I had put into the title and post routines and called stripslashes TWICE as a pre_post filter. Voila – attributes are preserved.
add_filter('pre_post', 'stripslashes', 40);
add_filter('pre_post', 'stripslashes', 45); // 2nd Time
I also added this little section in default-filters.php:
// Slash problems when integrated with WordPress
if (defined('WP_BB') && WP_BB) {
add_filter('post_text', 'stripslashes');
add_filter('get_topic_title', 'stripslashes');
add_filter('get_bb_title', 'stripslashes');
add_filter('edit_text', 'stripslashes');
}
And it stripped out the slashes in titles, browser bars, posts, edit screens, etc. (Note there is a missing semi-colon after the sort_tag_heat_map line – you need to add on if you put this at the end)
This is still a hack. I don’t have magic quotes on. I still need to dig and find out why there seems to be alternate behavior when wordpress is integrated or not. Maybe WordPress is turning on magic quotes and bbPress doesn’t expect it to be on?
Still digging.
I’m using this code in my Graphic Display Ranks plugin:
$path_to_subdirectory= bb_get_option('uri') . "my-plugins/ranks/";
$get_config = $path_to_subdirectory . "gdr_config.php";
include($get_config);
The plugin works just fine on the forum, but on the admin pages I’m getting these warnings:
Warning: main(my-plugins/ranks/gdr_config.php): failed to open stream: No such file or directory in /home/brightan/public_html/bbPress/my-plugins/display-rank-images.php on line 43
Warning: main(my-plugins/ranks/gdr_config.php): failed to open stream: No such file or directory in /home/brightan/public_html/bbPress/my-plugins/display-rank-images.php on line 43
Warning: main(): Failed opening ‘my-plugins/ranks/gdr_config.php’ for inclusion (include_path=’.:/usr/local/lib/php’) in /home/brightan/public_html/bbPress/my-plugins/display-rank-images.php on line 43
I’m pretty sure it’s something to do with the path, but what am I not seeing?