jkkenzie Posted April 12, 2014 Share Posted April 12, 2014 hi, i migrating an old CMS and there is something am not understanding: For some reason if magic_quotes_gpc is turned off, uploads dont work. Function below: function myupload($dir, $filein, $exclude=array(), $include=array(), $specs=array(), $det=array()) { if(is_array($filein)) { THIS IF RETURNS FALSE. I.E IT DOES NOT GO THROUGH HERE... IT JUMPS TO ELSE.. It seems the the $filein supplied to this function has a problem, though print_r show the value 1. $filein comes from the call below: myupload('../UserSiteFiles/'.rawurldecode($_POST['currentdir']), $_FILES['uploads']) WHAT happens to $_FILES and $_POST when magic_quotes_gpc=off ?? Thanks... Link to comment https://forums.phpfreaks.com/topic/287713-migrating-from-magic_quotes_gpc/ Share on other sites More sharing options...
mac_gyver Posted April 12, 2014 Share Posted April 12, 2014 magic_quotes wouldn't affect the $_FILES array in that way. it's likely your code leading up to that point is overwriting $_FILES['uploads'] with a 1. Link to comment https://forums.phpfreaks.com/topic/287713-migrating-from-magic_quotes_gpc/#findComment-1475880 Share on other sites More sharing options...
jkkenzie Posted April 12, 2014 Author Share Posted April 12, 2014 Thanks: The only clue i have is magic_quotes_gpc when it on uploads work. No particular error at the moment. Link to comment https://forums.phpfreaks.com/topic/287713-migrating-from-magic_quotes_gpc/#findComment-1475886 Share on other sites More sharing options...
jkkenzie Posted April 12, 2014 Author Share Posted April 12, 2014 I cant believe it was just making the $_FILES an array: i dont know if this is right... array($_FILES['uploads']); if(myupload('../UserSiteFiles/'.rawurldecode($_POST['currentdir']), $_FILES['uploads'])){?> I just added... array($_FILES['uploads']); and it worked, file could be uploaded. Link to comment https://forums.phpfreaks.com/topic/287713-migrating-from-magic_quotes_gpc/#findComment-1475890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.