TinyPortal

Development => Support => Topic started by: Lum-chan on January 25, 2011, 09:50:08 PM

Title: [TP 1.0 RC1] Download Manager: ' is replaced with /' . How to prevent this?
Post by: Lum-chan on January 25, 2011, 09:50:08 PM
Link to my site: http://forum.lum-chan.com
SMF version: SMF ver. 1.1.12
TP version: TP ver. 1.0 RC 1
Default Forum Language: English
Theme name and version: Dark Green (color green for Default core)
Browser Name and Version: Firefox 3.16.13 / IE 6.0.2900.5512
Mods installed: Only affects TP 1.0 RC 1
Related Error messages: none

Since I have upgraded to TP 1.0 RC1 I have some odd additions to the text in the description box of any category in the download manager. When I type we'll, it will show as we/'ll after a save. If I save it again, an additional / will be added. This happens in the category description box and in the file description box. Both admin, regular users and guests see this happen.

It doesn't show up in any article I write and on SMF 1.1.12 this issue doesn't occur. Only in the download manager this odd problem will occur. I have included screen-shots of the actual situation.

Currently, the database is at UTF-8

I must mention this: All existing text was ok when I entered them in the download manager of a earlier version of TP but I can't remember which version that was; probably 1.0 Beta 3.

I searched the forums but only found some topics with similar problems using Shoutbox. This doesn't happen at my site. When I type 'test' in the shoutbox, it shows as 'test'.

Any suggestions on how to fix this?
Title: Re: [TP 1.0 RC1] Download Manager: ' is replaced with /' . How to prevent this?
Post by: ZarPrime on January 26, 2011, 05:51:07 AM
Lum-chan,

The issue you are seeing was present in many of the TinyPortal Modules and are currently being worked on.  Some have been solved and some haven't.  It is not as much of a bug as it is with the differences between how SMF handles slashes between SMF 1.1.x and SMF 2.0.

Much of the latest TinyPortal was written for SMF 2.0 and some of the instances of the presence of these slashes were inadvertently missed when designing the code to work with SMF 1.1.x, which you are using.  This is why you are seeing them and why someone using SMF 2.0 won't see the same issue.

Ichbin will be better able to discuss this with you.  It's quite possible that the issue has been fixed for the next release of TinyPortal and, if so, he may be able to tell you what you will need to change to keep it from happening.  I'm sure he will respond when he gets a chance.

ZarPrime
Title: Re: [TP 1.0 RC1] Download Manager: ' is replaced with /' . How to prevent this?
Post by: Lum-chan on January 26, 2011, 07:38:20 AM
Thanks ZarPrime, I'll await the infomation, if available, from Ichbin.
Title: Re: [TP 1.0 RC1] Download Manager: ' is replaced with /' . How to prevent this?
Post by: IchBin on January 28, 2011, 05:22:50 PM
In Sources/TPdlmanager.php on about line #2068 look for this line:
tp_query("UPDATE " . $tp_prefix . "dlmanager SET description = '" . mysql_real_escape_string($value) . "' WHERE id=". $id, __FILE__, __LINE__);

Replace it with this line:
tp_query("UPDATE " . $tp_prefix . "dlmanager SET description = '" . mysql_real_escape_string(stripslashes($value)) . "' WHERE id=". $id, __FILE__, __LINE__);
Title: Re: [TP 1.0 RC1] Download Manager: ' is replaced with /' . How to prevent this?
Post by: Lum-chan on January 28, 2011, 11:48:02 PM
Hello IchBin,
Made the modifications to this file and it all works like a charm!
Thank you very much!

[Edit]
That's odd, this modification solved my long articles issue too. Old articles which were very long, got truncated after about 25 lines. After applying this mod, it all works again and I can enter huge leaps of text again. Nice! Tried to edit a few pages including the one that failed and all articles are displaying correctly now without truncating  :D
[/edit]

If you lived nearby, i'd buy you a nice cold beer!