Replace split() with explode() and preg_split() where appropriate as split() is deprecated as of PHP5.3.0. Added a few more return/parameter type comments, fix uncommented 'boundary' content-type and check more for existance of array before comparing contents