It happened when submitting a new story. When the text in Description field contains the character 'n', the n is converted into a newline character \n, causing the text is break up.
Here's the code from editlink.php I think is causing the problem. After publishing the story I can go back to edit it, replace the 'n', take out the linebreaks and then submit, and everything's back to normal.
HTML Code:
$linkres->category=$_POST['category'];
if($linkres->title != strip_tags(trim($_POST['title']))){
$linkres->title = strip_tags(trim($_POST['title']));
$linkres->title_url = makeUrlFriendly($linkres->title);
}
$linkres->content = strip_tags(trim($_POST['bodytext']), Story_Content_Tags_To_Allow);
$linkres->tags = tags_normalize_string(strip_tags(trim($_POST['tags'])));
if($_POST['summarytext'] == ""){
$linkres->link_summary = utf8_substr(strip_tags(trim($_POST['bodytext']), Story_Content_Tags_To_Allow), 0, StorySummary_ContentTruncate - 1);
$linkres->link_summary = str_replace("\n", "<br />", $linkres->link_summary);
// added
$linkres->link_summary = str_replace("\\r\\n", "<br />", $linkres->link_summary);// +
} else {
$linkres->link_summary = $db->escape($_POST['summarytext']);
$linkres->link_summary = strip_tags(trim($linkres->link_summary), Story_Content_Tags_To_Allow);
$linkres->link_summary = str_replace("\n", "<br />", $linkres->link_summary);
// added
$linkres->link_summary = str_replace("\\r\\n", "<br />", $linkres->link_summary);// +
if(strlen($linkres->link_summary) > StorySummary_ContentTruncate){
loghack('SubmitAStory-SummaryGreaterThanLimit', 'username: ' . $_POST["username"].'|email: '.$_POST["email"], true);
$linkres->link_summary = utf8_substr($linkres->link_summary, 0, StorySummary_ContentTruncate - 1);
$linkres->link_summary = str_replace("\n", "<br />", $linkres->link_summary);
}
}
Any help appreciated.






Linear Mode




