954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

ckeditor word filters

Hi,

I am using CKEditor (FCK) and I want to filter certain things from being used by users like (.com, <, >) symbols and words. Is there any plugin available for this or in which way i can do this? any help please..

thanks
rave

Venugopal Ravi
Newbie Poster
6 posts since Nov 2010
Reputation Points: 10
Solved Threads: 0
 

have you tried using an array in a str_replace command?

$string = 'test.com/%20\\\';
$array = array ('.com', '%', '\', '/');
$string = str_replace($array, '', $string;


This should just return the word test. I havent tried it but pretty sure you could use that.

whiteyoh
Posting Pro in Training
479 posts since Jun 2009
Reputation Points: 15
Solved Threads: 15
 

sorry, test20

whiteyoh
Posting Pro in Training
479 posts since Jun 2009
Reputation Points: 15
Solved Threads: 15
 

Do you need this as interactive functionality (before post) or server-side after posting? The former will rely on JS, the latter on PHP. However JS can be circumvented, so a JS functionality would also require PHP backup.

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

you could control it all either way. I only know for certain how to do it in PHP.

just before you commit you should use some if statements to perhaps output the new string and then get the user to say they are happy with it

whiteyoh
Posting Pro in Training
479 posts since Jun 2009
Reputation Points: 15
Solved Threads: 15
 

CKEditor uses JS, so if you're looking to embed this functionality into the interface, I assume it will be JS. BUT, as mentioned, if you want to ensure CLEAN input to the DB, you need to use some string or preg* functions.

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: