I have just installed the latest version of CKEditor and have made the the config.js changes as below. But, when entering text, all text after a period is excluded from entry into my database. Any advice on what Im doing wrong. If I leave the config.js empty then all works fine.
/**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.toolbar = [
{ name: 'styles', items: [ 'Format','Font','FontSize', 'TextColor' ,'BGColor' ]},
{ name: 'basicstyles', items: ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript']},
'/',
{ name: 'insert', items: [ 'Link', 'Unlink', 'Image', 'Smiley' ]}
];
config.blockedKeystrokes =
[
// This is actually the default value.
CKEDITOR.CTRL + 66 /*B*/,
CKEDITOR.CTRL + 73 /*I*/,
CKEDITOR.CTRL + 85 /*U*/,
// Cut, Copy & Paste
CKEDITOR.CTRL + 88 /*X*/,
CKEDITOR.CTRL + 67 /*C*/,
CKEDITOR.CTRL + 86 /*V*/,
CKEDITOR.SHIFT + 45
];
};

I took the edits out of
I took the edits out of config.js and it till seems to have the same problem. All text after a period is removed from the post.
Does anyone have any thoughts?
Normally when text is
Normally when text is submitted it's out of CKEditor's hands, so it's must be something server-side. Can you provide a sample of the code before and after it's submitted to the server? First time we hear of such a case.
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
@sebstefanov is right. Please
@sebstefanov is right. Please attach text that you have in editor before pressing submit button. Please also describe exact TC steps to get this problem.
One more additional check you might want to do. You should have CKEditor/samples/ajax.html sample in your editor instance (if you haven't removed samples folder). Please run this sample in browser, create editor, insert your text, then destroy editor and create it once more. I problem occurs there then this might be editor fault. If not then this might be server-side issue - perhaps some filter that for some reason cuts out part of text.
It would be also good to check (e.g. with Fiddler2) what gets send to server in request.
Hi Everyone
Hi Everyone
Here are some addtionial details to support the problem fault finding.
Im viewing the ditor using Firefox v22
The text I typing is:
Hello Dave. Welcome to the website. Please feel free to add more video.
The text that gets captured is:
Hellow Dave.
Previously I have been using FCKEditor. Here is the code for my original FCKEditor installation:
<?php include_once ('classes/config.php'); include_once ('classes/sessions.php'); ///////////////////////// //CHECK IF FORM SUBMITTED ///////////////////////// if($_POST['submitted'] == 'yes'){ $member_id = $_POST['member_id']; $profile_comment = $_POST['FCKeditor1'];echo $profile_comment; //check if user is logged in if ($user_id == "") { echo '<p align="center"><font color="#FF4242" face="Arial"><b>'.$config['video_comments_login'].'</b></font>'; die(); } //check if blog_reply have been filled in if ($profile_comment == "") { echo '<p align="center"><font color="#FF4242" face="Arial"><b>'.$config['video_comments_error_comment'].'</b></font>'; die(); } //ban newbie from posting urls and othr banned words if (banned_comments($user_id, $profile_comment)) { echo '<p align="center"><font color="#FF4242" face="Arial"><b>'.$config['illegal_url_comments_msg'].'</b></font>'; die(); } // comment flood control $user_id = mysql_real_escape_string($user_id); $members_id = mysql_real_escape_string($member_id); $profile_comment = mysql_real_escape_string($profile_comment); $comment_table = 'profilecomments'; $id_name = 'members_id'; $proceed = flood_check ( $user_id, $comment_table, $id_name, $member_id ); if ( $proceed[0] == 'false' ) { echo $proceed[1]; die(); } //check if user allows blog replies $sql1 = "SELECT * FROM privacy WHERE user_id = $member_id AND profilecomments = 'no'"; $result1 = @mysql_query($sql1); if(@mysql_num_rows($result1) != 0){ echo '<p align="center"><font color="#FF4242" face="Arial"><b>'.$config['video_comments_not_allowed'].'</b></font>'; die(); } //insert into comments table $sql = "INSERT into profilecomments (by_id, by_username, members_id, comments, todays_date) VALUES ($user_id, '$user_name', '$member_id', '$profile_comment', NOW())"; //mysql_query($sql); $query = @mysql_query($sql); UW_insert_profilecomment(); if(!$query) { die("Error while during sql_query. Error Output: <br/>". mysql_errno() . ": " . mysql_error(). "<br/>"."Query follows:<br/>".$query); @mysql_close(); die(); } //start of email notification mod if($user_id!=$member_id){ list($username,$email)=mysql_fetch_row(mysql_query("SELECT user_name,email_address FROM member_profile WHERE user_id=$member_id LIMIT 1")); $comment=strip_tags(html_entity_decode($_POST['FCKeditor1'], ENT_QUOTES)); $message="Hi $username,\n\n$user_name commented on your profile at Channel P101tv. \n\nClick here to view the comments.\n\n$base_url/members/".str_replace(' ','%20',$username)."\n\n\nRegards\nThe Channel P101tv Team\n$base_url"; @mail($email,'New Comment on Your "Channel P101tv" Member Profile',$message,'From: '.$config['from_system_name'].' <'.$config['notifications_from_email'].'>'); } //end of email notification mod // echo success message echo '<p align="center"><font color="#009933" face="Arial"><b>'.$config['video_comments_success'].'</b></font>'; $comments = ""; die(); } else { //this is the get request // SHOW FORM //check if user is logged in if ($user_id == "") { echo '<div style="margin-left:12px; text-align:left;"><font color="#FF0000" face="Arial"><b>'.$config['video_comments_login'].'</b></font></div>'; die(); } else { $member_id = $_GET['uid']; ///FCK EDITOR________________________________________________________________________ include('fckeditor/fckeditor.php'); $sBasePath = "$base_url/fckeditor/"; $oFCKeditor = new FCKeditor('FCKeditor1'); $oFCKeditor->BasePath = $sBasePath; $oFCKeditor->CustomConfigurationsPath = "fckconfig.js"; $oFCKeditor->ToolbarSet = 'Basic'; $oFCKeditor->SkinPath = $sBasePath + 'editor/skins/silver/'; $oFCKeditor->Value = "$profile_comment"; $oFCKeditor->Width = '690'; $oFCKeditor->Height = '220'; $FCKeditor1 = $oFCKeditor->CreateHtml(); $my_edit = $FCKeditor1; //____________________________________________________________________________________ echo '<br /><div align="center"> <form id="comments_reply" action="javascript:ahahscript.likeSubmit(\''.$base_url.'/memberprofile_comments_ajax.php\', \'post\', \'comments_reply\', \'MP_comments_axaj\');"> '.$my_edit.' <input type="hidden" value="'.$member_id.'" name="member_id" /> <input type="hidden" value="yes" name="submitted" /> <br /> <input type="submit" value="Post Reply" name="B3" /> </form></div> <br />'; } } ?>And here is the code modified for the new CKEitor:
<?php include_once ('classes/config.php'); include_once ('classes/sessions.php'); ///////////////////////// //CHECK IF FORM SUBMITTED ///////////////////////// if($_POST['submitted'] == 'yes'){ $member_id = $_POST['member_id']; $profile_comment = $_POST['FCKeditor1'];echo $profile_comment; //check if user is logged in if ($user_id == "") { echo '<p align="center"><font color="#FF4242" face="Arial"><b>'.$config['video_comments_login'].'</b></font>'; die(); } //check if blog_reply have been filled in if ($profile_comment == "") { echo '<p align="center"><font color="#FF4242" face="Arial"><b>'.$config['video_comments_error_comment'].'</b></font>'; die(); } //ban newbie from posting urls and othr banned words if (banned_comments($user_id, $profile_comment)) { echo '<p align="center"><font color="#FF4242" face="Arial"><b>'.$config['illegal_url_comments_msg'].'</b></font>'; die(); } // comment flood control $user_id = mysql_real_escape_string($user_id); $members_id = mysql_real_escape_string($member_id); $profile_comment = mysql_real_escape_string($profile_comment); $comment_table = 'profilecomments'; $id_name = 'members_id'; $proceed = flood_check ( $user_id, $comment_table, $id_name, $member_id ); if ( $proceed[0] == 'false' ) { echo $proceed[1]; die(); } //check if user allows blog replies $sql1 = "SELECT * FROM privacy WHERE user_id = $member_id AND profilecomments = 'no'"; $result1 = @mysql_query($sql1); if(@mysql_num_rows($result1) != 0){ echo '<p align="center"><font color="#FF4242" face="Arial"><b>'.$config['video_comments_not_allowed'].'</b></font>'; die(); } //insert into comments table $sql = "INSERT into profilecomments (by_id, by_username, members_id, comments, todays_date) VALUES ($user_id, '$user_name', '$member_id', '$profile_comment', NOW())"; //mysql_query($sql); $query = @mysql_query($sql); UW_insert_profilecomment(); if(!$query) { die("Error while during sql_query. Error Output: <br/>". mysql_errno() . ": " . mysql_error(). "<br/>"."Query follows:<br/>".$query); @mysql_close(); die(); } //start of email notification mod if($user_id!=$member_id){ list($username,$email)=mysql_fetch_row(mysql_query("SELECT user_name,email_address FROM member_profile WHERE user_id=$member_id LIMIT 1")); $comment=strip_tags(html_entity_decode($_POST['FCKeditor1'], ENT_QUOTES)); $message="Hi $username,\n\n$user_name commented on your profile at Channel P101tv. \n\nClick here to view the comments.\n\n$base_url/members/".str_replace(' ','%20',$username)."\n\n\nRegards\nThe Channel P101tv Team\n$base_url"; @mail($email,'New Comment on Your "Channel P101tv" Member Profile',$message,'From: '.$config['from_system_name'].' <'.$config['notifications_from_email'].'>'); } //end of email notification mod // echo success message echo '<p align="center"><font color="#009933" face="Arial"><b>'.$config['video_comments_success'].'</b></font>'; $comments = ""; die(); } else { //this is the get request // SHOW FORM //check if user is logged in if ($user_id == "") { echo '<div style="margin-left:12px; text-align:left;"><font color="#FF0000" face="Arial"><b>'.$config['video_comments_login'].'</b></font></div>'; die(); } else { $member_id = $_GET['uid']; //CKEditor________________________________________________________________________ include('ckeditor/ckeditor.php'); $ckeditor = new CKEditor(); $ckeditor->replace('FCKeditor1'); //____________________________________________________________________________________ echo '<br /><div align="center"> <form id="comments_reply" action="javascript:ahahscript.likeSubmit(\''.$base_url.'/memberprofile_comments_ajax.php\', \'post\', \'comments_reply\', \'MP_comments_axaj\');"> <textarea name="FCKeditor1"></textarea> <input type="hidden" value="'.$member_id.'" name="member_id" /> <input type="hidden" value="yes" name="submitted" /> <br /> <input type="submit" value="Post Reply" name="B3" /> </form></div> <br />'; } } ?>I hope this helps.
I tried a little experiment.
I tried a little experiment.
I took this code:
//CKEditor________________________________________________________________________ include('ckeditor/ckeditor.php'); $ckeditor = new CKEditor(); $ckeditor->replace('FCKeditor1'); //____________________________________________________________________________________and commented out $ckeditor replace like this:
//CKEditor________________________________________________________________________ include('ckeditor/ckeditor.php'); $ckeditor = new CKEditor(); //$ckeditor->replace('FCKeditor1'); //____________________________________________________________________________________This gave me a simple plain text area. I tried the same text string entry and it worked perfectly. So something in ckeditor seems to be causing the text to break after a period.
I have narrowed down the code
I have narrowed down the code that seems to be causing my problems and enclose it below:
This code was OK with FCKEditor but not CKEditor. Any thoughts on what is causing the problem? function banned_comments($member_id, $comments) { $result = false; //Regular expression for URL $urlreg = '@\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))@'; //allow sites $sitereg = array( '/http:\/\/www.domain.com/i', '/http:\/\/www.mydomain.com/i', '/http:\/\/www.hisdomain/i' ); switch (member_site_ranking($member_id)) { case "": case "badge_0.png": case "badge_1.png": // The no. of link in comments $count = preg_match_all($urlreg, $comments, $matches ); // The no. of allowed links in comments $count2 = 0; foreach ($sitereg as $site) $count2 = $count2 + preg_match_all($site, $comments, $matches2 ); if ($count == $count2) $result = false; else $result = true; break; } return $result; }CKEditor doesn't remove chars
CKEditor doesn't remove chars after '.' character.
Could you perhaps debug your whole request? You could use Fiddler2 to make sure if line after '.' reaches server.
Next you could use IDE like Eclipse (it has PHP module) to debug server-side code you have created. At first glance I thought that your regex is causing this but it doesn't match your sample text at all. Have you got perhaps any other regexp that might be causing this?
NOTE: I have noticed that after "Hello Dave." there are two spaces - perhaps this is regexp issue after all and one of your filters has problems with it.
Seeing this as well after the update
Not sure if anyone is still reading this but I have seen this as well after updating to the most recent CKEditor. Very problematic.