Det er smartere lavet i versioner efter 4.0.2 i 4.0.4 pl1 (som er den nyeste) er der en bug som jeg har en patch til. Min kode til 4.0.4 pl1 ser sådan ud:
<?php
function fix_php_upload_bug($tmp) { $infile=fopen($tmp,\"r\"); // Open the file for the copy $outfile=fopen(\"$tmp.new\",\"w\"); // create a new temp file $header=fgets($infile,255); //get the 1st line (netscape sometimes doesn\'t add a Content-type line) //if its more than just a \\r\\n sequence then if (strlen($header)>2) $header=fgets($infile,255); //get next line also while(!feof($infile)) { // Loop through the remaining file $temp=fread($infile,128); fwrite($outfile,$temp,strlen($temp)); //copying contents to new temp file } fclose($outfile); fclose($infile); copy(\"$tmp.new\",\"$tmp\"); //replace the original with our new bug fixed file unlink(\"$tmp.new\"); //and delete the new file return filesize($tmp); //return a true file size }
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.