Public paste
to long?
By: fruffl | Date: Jan 31 2010 13:24 | Format: PHP | Expires: never | Size: 693 B | Hits: 478

  1. <?php
  2.  
  3. /*
  4. file-path autorepair
  5.  
  6. convert
  7. lala///\////\////\////\////\////\////\//sxsx///\//
  8.  
  9. to
  10. /lala/sxsx
  11. */
  12.  
  13. if(isset($temp[$v]))
  14.   $temp[$v] = implode(chr(0x2F),array_map("rawurlencode", (explode(chr(0x2F), $temp[$v] = (substr(($temp[$v] = (substr(($temp[$v] = ereg_replace(chr(0x28).chr(0x2F).chr(0x2B).chr(0x29), chr(0x2F), str_replace(array(chr(0x5C),chr(0x2F).chr(0x2E).chr(0x2E).chr(0x2F),chr(0x2E).chr(0x2E).chr(0x2F),chr(0x2F).chr(0x2E).chr(0x2E),chr(0x2F).chr(0x2E),chr(0x2E).chr(0x2F),chr(0x2A)), chr(0x2F), $temp[$v]))), 0, 1)  != chr(0x2F)) ? chr(0x2F).$temp[$v] : $temp[$v]), -1, 1) == chr(0x2F)) ? substr($temp[$v], 0, strlen($temp[$v])-1) : $temp[$v]))));