Info
- 22 posts
- 14 voices
- Started 2 years ago by Niteblade
- Latest reply from iamanasha
- This topic is not resolved
Apostrophe and or quotation marks cause backslash to appear.
-
- Posted 2 years ago #
Hello. I notice on my fresh and clean installation that when I use "quotation marks" or when I use an apostrophe in contractions (can't, shouldn't, etc.), a backslash appears.
"quotation marks" --> \"quotation marks\"
can't --> can\'tI don't know what's causing this.
I have my own dedicated server, so I'm in complete control of everything.
-
- Posted 2 years ago #
What version are you using, is it integrated with WordPress and are you using a language file?
-
- Posted 2 years ago #
I think I may be having the same problem. It's making it very hard to post links in the forum without them breaking. It also seems to be stripping out the http at the beginning of the link, and " gets converted to ' whenever I edit a post. In fact, the only way I can get an a href link to show up correctly is to put quotes of any kind, single or double, around the URL. I'm using 1.01, not sure if I have a language file. Here's the forum in question: http://forum.blitzentrapper.net
-
- Posted 2 years ago #
Thanks for the info. Since your site is in English, it's probably not using another language file. You'd have set it so you would know. It does appear to be integrated with WordPress? If so, what version WordPress and what do you do for integration?
-
- Posted 2 years ago #
I'm having this exact problem.
Fresh install of 1.0.2, integrated with WordPress (finally!), and even though I deactivated all plugins and tested it again, and it's still doing it.
Any ideas?
-
- Posted 2 years ago #
Never mind - I got it, thanks to an old post from two years ago.
The code has changed a bit, so here's how I fixed it:
1) open up /bb-includes/functions.bb-template.php
2) replace line 1074 with:
return stripslashes(apply_filters( 'get_topic_title', $topic->topic_title, $id ));
3) and line 1782:
return stripslashes(apply_filters( 'get_post_text', $bb_post->post_text, $bb_post->post_id ));That did the trick for me.
-
- Posted 2 years ago #
Is this secure?
-
- Posted 2 years ago #
Howdy - I don't have an editor that shows lines - what is the text on the line I should replace?
Will this screw up future upgrades?
-
- Posted 2 years ago #
HI adam - thanks for the possible cure. I made the changes you suggested (finally got proper line editor) and I'm still getting those slashes.... check it out - http://www.triplepundit.com/forum
Any ideas?
-
- Posted 2 years ago #
I get the same problem.
-
- Posted 2 years ago #
actually, adamkayce's fix worked for me! thanks!
-
- Posted 2 years ago #
adam's fix will mean backslashes will be stored in the database. Worse, on upgrade, his changes will be lost and there all the backslashes will be.
Better to do this as a plugin, and filtering content before it goes in the db.
Just write a plugin, upload it and activate it. Like this:
<?php /* Plugin Name: Strip Slashes */ add_filter('pre_topic_title', 'stripslashes', 40); add_filter('pre_post', 'stripslashes', 40); add_filter('bb_add_topic_tags', 'stripslashes', 40); ?> -
- Posted 2 years ago #
Is there a way to fix this issue inside a theme?
The 'add_filter' route only seems to remove slashes from the front-end, but they still show up in the admin.
Anybody know of a 'complete' fix without editing the core?
-
- Posted 2 years ago #
ok, found the answer wooooooo!
The 'real' reason this wasn't working was....
'magic_quotes_gpc' is set to 'off' on my server (in php.ini)
All these other solutions are band-aids, my hunch is that making sure magic quotes is 'on' is the solution.
-
- Posted 2 years ago #
For now this fixes things indeed, however a warning from PHP.net:
"/This feature has been /DEPRECATED/ as of PHP 5.3.0 and /REMOVED/ as of PHP 6.0.0. Relying on this feature is highly discouraged./"Putting "php_value magic_quotes_gpc 1" in my .htaccess file worked for me... for now.
Also added: "error_reporting( E_ALL & ~E_DEPRECATED );" to my bb-config.php
-
- Posted 1 year ago #
YES!!! Adding this to the .htaccess file does indeed work:
php_value magic_quotes_gpc 1
I'm worried that now I'm down a rabbit hole in terms of future upgrades and so on. But what can you do...
-
- Posted 1 year ago #
I added the line above - php_value magic_quotes_gpc 1 - to .htaccess, but it had no effect at all.
Next?
-
- Posted 1 year ago #
magic_quotes_gpc should be off - always, it's evil.
If your installation doesn't work properly with it off it is either a bug or something else is wrong.
-
- Posted 1 year ago #
added php_value magic_quotes_gpc 1 - to .htaccess in both WPMU ROOT and BBPRESS ROOT DIRS, no effect...
-
- Posted 1 year ago #
OK, created a file called stripslashes.php and uploaded it to the bb-plugins directory. Used the code from above, and I do have the magic quotes thing going...I think I may take that out of my htacess files though...if it works now...
-
- Posted 1 year ago #
I can confirm that creating a plugin as mentioned above did in fact fix the problems I was having
-
- Posted 1 year ago #
AdamKayce says: Never mind - I got it, thanks to an old post from two years ago.
The code has changed a bit, so here's how I fixed it:
1) open up /bb-includes/functions.bb-template.php
2) replace line 1074 with:
return stripslashes(apply_filters( 'get_topic_title', $topic->topic_title, $id ));
3) and line 1782:
return stripslashes(apply_filters( 'get_post_text', $bb_post->post_text, $bb_post->post_id ));That did the trick for me.
{That worked for me too. It did the trick in the frontside and backoffice.}
-
You must log in to post.