Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Security - Other
Author Message
shmk
Worker
Worker



Joined: Dec 21, 2004
Posts: 116

PostPosted: Sun Apr 20, 2008 4:19 am Reply with quote

I'm getting from an external source a PNG image in raw format (encoded in base64).

And with this code I'll echo on the screen.

Code:


$img=base64_decode($_POST['img']);

header("Content-type: image/png");
echo $img;


How can I check if the datas received are real PNG raw (and not malicious code) ?
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Apr 20, 2008 9:23 pm Reply with quote

Check the imagecreatefromstring function. I think it's exactly what you need Smile
 
View user's profile Send private message
shmk







PostPosted: Wed Apr 23, 2008 7:25 am Reply with quote

Perfect Wink
 
Raven







PostPosted: Wed Apr 23, 2008 9:03 am Reply with quote

RavensScripts
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Security - Other

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©