Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Wordpress/Vanilla Intergration Issue with single quote
I an having trouble with slashes showing up in my posts when ever someone uses a ' or any other slashable character. You can see an example of this issue I am having here:
http://dg.mmorpgaming.com/forums/comments.php?DiscussionID=4
You will notice in posts 8 and 9 that the single quote is slashed out. Is any one else having this issue with slashes?
edit: I have since moved the forums and refreshed the DB.
http://dg.mmorpgaming.com/forums/comments.php?DiscussionID=4
You will notice in posts 8 and 9 that the single quote is slashed out. Is any one else having this issue with slashes?
edit: I have since moved the forums and refreshed the DB.
0
This discussion has been closed.
Comments
<?php /* Extension Name: Remove Backslashes Extension Url: http://lussumo.com/doc/ Description: Removes backslashes from the posts. Version: 1.0 Author: Ian Sheridan Author Url: http://www.savagevines.com */ if( in_array($Context->SelfUrl, array('post.php','comments.php', 'index.php', 'discussion.php', 'extension.php')) ) { class RemoveBackslashesFormatter extends StringFormatter { function Parse($String, $Object, $FormatPurpose) { if ($FormatPurpose == FORMAT_STRING_FOR_DISPLAY) { return $this->RemoveBackslashesParse($String); } else { return $String; } } function ProtectString ($String) { return $String; } function RemoveBackslashesParse($message) { return stripslashes($message); } } $RemoveBackslashesFormatter = $Context->ObjectFactory->NewObject($Context, "RemoveBackslashesFormatter"); $Context->StringManipulator->AddGlobalManipulator("RemoveBackslashes", $RemoveBackslashesFormatter); } ?>
All it does is removes the backslashes that are inserted by either Wordpress or Vanilla (this is the only incompatibility that I have found). To make sure that it gets used before any other extension you must edit the conf/extension.php file to make sure that this extension gets included before any of your other post filtering extensions. I probably should remove the "if ($FormatPurpose == FORMAT_STRING_FOR_DISPLAY) {" too but I have not done that yet.
Automatically inserting slashes in form inputs is called "magic quotes". It's something that PHP often does by default because it hates you. One of the purposes of the Vanilla function ForceIncomingString() is to strip out these slashes if PHP is configured to insert them.
All I can think of is maybe you have some Vanilla extension that is somehow ruining the normally good and sane work of ForceIncomingString(). What other Vanilla extensions are you using?