sNews Forum

Previous sNews versions => sNews 1.3 => sNews 1.3 problem solving => Topic started by: nexus6 on April 13, 2006, 05:42:28 pm

Title: apostrophe in text causes problem when entering text in textarea
Post by: nexus6 on April 13, 2006, 05:42:28 pm
I am using sNews 1.3 and when I copy and paste text that contains any apostrophes into the text area when creating a new article it tells me that I have been succesful when I go to publish it yet when I refresh the site to view the new article it does not appear anywhere. If I manually escape the apostrophe by putting a '\' before it it works fine. Also, once the text is entered into an article it works ok when I edit it, can anyone help please. I am using 1.3 as I could not upload the htaccess file in 1.4 to my server. Thanks
Title: apostrophe in text causes problem when entering text in textarea
Post by: George Antoniadis on April 13, 2006, 07:19:49 pm
Welcome to snews~! ;)

I'm not quite sure about this on 1.3 but converting the ' to html entities should work...
I'll check this and get back to you`! ^_^
Title: apostrophe in text causes problem when entering text in textarea
Post by: bramsyuur on April 19, 2006, 07:59:31 pm
Welcome Caludio,
Why not tell about your problems using 1.4 verion?
Maybe I or others can resolve these problems...
bram.
Title: apostrophe in text causes problem when entering text in textarea
Post by: bramsyuur on April 19, 2006, 08:37:48 pm
Maybe a stupid question from me, but, are your using the same database 1.3 for 1.4? or are you created a new db with the spects in the readme.txt of a snews 1.4 file?

Quote from: claudio
Well my problem is hard to explain, it seems that everything was right, mod rewrite is enabled, never had problems with friendly URLs, even enabled it to another codes like 4images. No problems. THe problems seems to be there, since it's the big difference between 1.3 and 1.4. All I got is a blank page with 1.4. Checked and re-checked phpinfo and my submitted info (like sql, username, etc) but neither worked. I'm happy with 1.3 and solving the apostrophe problem would be the final thing I need to do to this be the perfect thing for me ;)
Title: apostrophe in text causes problem when entering text in textarea
Post by: Shaun Aneiros on April 19, 2006, 10:43:52 pm
in your php.ini file? are shot tags on or off?
Title: apostrophe in text causes problem when entering text in textarea
Post by: nexus6 on April 26, 2006, 02:35:46 pm
sorted it, I added a couple of lines in this section

function processing() {
   $action = $_REQUEST['action'];
     $id = $_REQUEST['id'];
     $name = $_POST['name'];
     $category = $_POST['category'];
     $description = $_POST['description'];
     $title = $_POST['title'];
     $comment = $_POST['editedcomment'];
     $text = $_POST['text'];
     $text_limit = $_POST['text_limit'];
     $auto_html = $_POST['auto_html'];
     $date = date('Y-m-d H:i:s');
     $display_title = $_POST['display_title'];
     $display_info = $_POST['display_info'];
     $commentable = $_POST['commentable'];
     $publish = $_POST['publish'];
     $publish_category = $_POST['publish'];
     $position = $_POST['position'];
     $display = $_POST['display'];
     $image = $_POST['image'];

I just added this to the above and it worked ok.

        $text = nl2br($text);
   $text = str_replace("'","''",$text);
Title: apostrophe in text causes problem when entering text in textarea
Post by: nexus6 on May 03, 2006, 02:59:18 pm
Good point, Cluadio. I had not thought of the comments section, as I have commenting turned off on this site at the moment. I will have a look at it soon and post a solution.