It shall be the duty of any magistrate or justice of the peace, making a commitment as provided in the first and second sections of this act of a minor to any society, to transfer his commitment, together with the various matters annexed thereto as provided in the third section of this act, to the district attorney of the county in which said commitment shall be made, and it shall be the duty of the district attorney, when the same shall be placed in his hands, or as soon as it is possible thereafter, to place the said commitment, with the matters annexed, in the hands of a judge sitting at quarter sessions, who shall examine the same, and shall indorse thereon an order for the detention of the said minor by the said society, or if he shall be of the opinion that the said minor has been wrongfully committed, he shall indorse upon the commitment an order for the discharge of the said minor: Provided, That nothing in this act contained shall be construed to interfere with the provisions of an act entitled "An act for the better securing of personal liberty and preventing unlawful imprisonment," passed on February 18, 1785, commonly called the habeas corpus act.
11 P.S. § 30