(a) Disclosure of name of victim of human trafficking.--Notwithstanding any other provision of law to the contrary, unless the court otherwise orders in a prosecution involving a victim of human trafficking, an officer or employee of the court may not disclose the identity of the victim of human trafficking to the public. Any record revealing the name of the victim of human trafficking shall not be open to public inspection.
(b) Affirmative defense.--An individual who is charged with any violation under section 5902 (relating to prostitution and related offenses) may offer the defense at trial that he engaged in the conduct charged because he was compelled to do so by coercion or the use of or a threat to use unlawful force against his person or the person of another, which a person of reasonable firmness in his situation would have been unable to resist.
(c) Diversionary program.--An individual who is charged with violating a trespassing, loitering, obstruction of highway, disorderly conduct or simple possession of a controlled substance statute as a direct result of being a victim of human trafficking, where the violation is his first offense, shall be given first consideration for a pretrial diversionary program by the judicial authority with jurisdiction over the violations. If the individual successfully completes the diversionary program, the court shall order that the individual's records of the charge of violating the statute shall be expunged as provided for under section 9122 (relating to expungement).
(d) Motion to vacate conviction.--
(1) An individual convicted under section 3503 (relating to criminal trespass), 5503 (relating to disorderly conduct), 5506 (relating to loitering and prowling at night time), 5507 (relating to obstructing highways and other public passages) or 5902 or an offense for simple possession of a controlled substance committed as a direct result of being a victim of human trafficking may file a motion to vacate the conviction.
(2) In order to be considered, a motion under this subsection must:
(i) Be in writing.
(ii) Be consented to by the attorney for the Commonwealth.
(iii) Describe the supporting evidence with particularity.
(iv) Include copies of any documents showing that the moving party is entitled to relief under this section.
(e) Official documentation.--No official determination or documentation is required to grant a motion under this section, but official documentation from a Federal, State or local government agency indicating that the defendant was a victim at the time of the offense creates a presumption that the defendant's participation in the offense was a direct result of being a victim.
(f) Grant of motion.--The court shall grant the motion if it finds that:
(1) The moving party was convicted of an offense described in subsection (d)(1).
(2) The conviction was obtained as a result of the moving party's having been a victim of human trafficking.
(g) Conviction vacated.--If the motion under subsection (d) is granted, the court shall vacate the conviction, strike the adjudication of guilt and order the expungement of the record of the criminal proceedings. The court shall issue an order to expunge all records and files related to the moving party's arrest, citation, investigation, charge, adjudication of guilt, criminal proceedings and probation for the offense.