Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: \r\n bug when article saving error occurs.  (Read 3263 times)

philmoz

  • High flyer
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 2001
    • fiddle 'n fly
\r\n bug when article saving error occurs.
« 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

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
Logged
Of all the things I have lost, it is my mind that I miss the most.