View Issue Details

IDProjectCategoryView StatusLast Update
0013247mantisbtattachmentspublic2012-08-17 14:11
ReporterDAK007340 Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
Product Version1.2.5 
Summary0013247: Bug in file "proj_doc_update.php"
Description

After you edit an existing project documentation, the escape sequences incorrectly displayed

Steps To Reproduce
  1. Update project documentation
  2. Edit description with carriage return
  3. Push update button
Additional Information

Solution:

Line 54
//$c_description = db_prepare_string( $f_description );
$c_description = $f_description;

TagsNo tags attached.
Attached Files
After update.jpg (21,479 bytes)   
After update.jpg (21,479 bytes)   

Relationships

duplicate of 0014541 closeddregad Remove calls to deprecated functions db_prepare* in "Docs" update page 
related to 0012955 closeddregad After updating a project documentation the file is damaged 

Activities

madboyprice

madboyprice

2012-03-21 02:07

reporter   ~0031502

I have been experiencing the same problem with the description and with the actual file that was updated. The updated file was corrupted and looked like this:

'UPDATE campaign_codes SET DESCRIPTION=\'GOOGLE BANNER\' WHERE CAMPAIGN_CODE=\'A1310Q10\';\r\nUPDATE campaign_codes SET DESCRIPTION=\'FACEBOOK BANNER\' WHERE CAMPAIGN_CODE=\'A1310Q11\';\r\n'

instead of:

UPDATE campaign_codes SET DESCRIPTION='GOOGLE BANNER' WHERE CAMPAIGN_CODE='A1310Q10'; UPDATE campaign_codes SET DESCRIPTION='FACEBOOK BANNER' WHERE CAMPAIGN_CODE='A1310Q11';

This causes major problems with images, OO documents and spreadsheets.

I am using Mantis version 1.2.8, PHP version 5.3.8 and MySQL version 5.5.17.

I have made the following change on line 105:

//$c_content = db_prepare_binary_string( fread ( fopen( $v_tmp_name, 'rb' ), $v_size ) );
$c_content = fread ( fopen( $v_tmp_name, 'rb' ), $v_size );

This is perhaps not the safest, but it is an internal Mantis instance and it seems to work.

Is there a better way?