Part of the EllisLab Network
   
 
$this->db-update() problem
Posted: 03 July 2009 07:55 AM   [ Ignore ]  
Summer Student
Total Posts:  26
Joined  05-22-2009

Hi
I have a following problem when I use

$this->db->update()

Everything it’s great, but if I use somewhere in content for tables this

../../

After update server automatically redirect to root.

Any Ideas?

Profile
 
 
Posted: 03 July 2009 08:45 AM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  2
Joined  09-18-2008

Hi Guntars,
Thanks for posting this. May I add more information as this happened on my server? smile
I made simple CMS where you can update website pages. Like Guntars already told there is strange issue after I submit form with changes for DB update.

Strange behaviour starting if I put in CMS content relative path to image then I can not save (submit) anything on server. Let me show example:

THIS WILL NOT WORK!

<p><img src="../../images/img_system/contact_us.jpg" alt="" /></p>

Under ‘not working’ I mean, you will not be able to save the changes on server and also you will be kicked out to root of the server as this is testing server.

THIS WILL WORK!

<p><img src="..& # 4 7 ;../images/img_system/contact_us.jpg" alt="" /></p>

Yes, if I replace [/] with [& # 4 7 ;] then it works but only one time. After you will try to do submit again (without any changes to text) will happened previous scenario.

After that I started to check out what you can submit whatever you like, slash , code samples anything, even [ ../ ] will be ok. Only if there are row with

../../

two dots and slash something is happening.

Not to mention all my inputs I am doing with FCKeditor which already change all in safe way.
I am wrapping all input like you can see here:

$foo = utf8_encode($_POST['foo']);

Still no results. One more strange thing. I am using same Data Base for local tests and for live tests. So basically from local host I can save everything and all works good. Why this not working on live webserver? Can anyone give some advice?

Just last thoughts. Because I am using same DB for local and live enviroment and I can save updates from local machine then maybe there is some security rules for some characters in some special row like (../../)?

Any help would be appreciate!

Profile
 
 
Posted: 03 July 2009 09:41 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  26
Joined  05-22-2009

It’s sorted.
Thanks, it was blocked by the server security the mod_security feature

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 721, on January 06, 2010 09:38 AM
Total Registered Members: 115028 Total Logged-in Users: 64
Total Topics: 122468 Total Anonymous Users: 4
Total Replies: 647385 Total Guests: 463
Total Posts: 769853    
Members ( View Memberlist )