sNews Forum

sNews 1.7 (current stable version) => Patches/fixes => Topic started by: philmoz on February 23, 2009, 01:21:49 pm

Title: \r\n bug when article saving error occurs.
Post by: philmoz on February 23, 2009, 01:21:49 pm
if article name or sef is already in db or title was left empty, then an error notification is generated.
However, the end of line chars are displayed in the text box of the editor as per report here (http://snewscms.com/forum/index.php?topic=8255.msg58647#msg58647)

To rectify (supplied by Joost)
A patch:
Replace in function process ( in snews.php)
Code: (old code) [Select]
<?php
case 'admin_article':
$_SESSION[_SITE.'temp']['title'] = $title;
$_SESSION[_SITE.'temp']['seftitle'] = $seftitle;
$_SESSION[_SITE.'temp']['text'] = $text;
?>

with
Code: (NEW code) [Select]
<?php
case 'admin_article':
$_SESSION[_SITE.'temp']['title'] = $_POST['title'];
$_SESSION[_SITE.'temp']['seftitle'] = $_POST['seftitle'];
$_SESSION[_SITE.'temp']['text'] = $_POST['text'];
?>

Note: If magic_quotes_gpc is turned on, add the following to .htaccess:
Code: [Select]
php_flag magic_quotes_gpc OFF