To provide for the erection or purchase of lock-ups or watch-houses in some convenient part of the city, for the detention and confinement of vagrants and persons arrested by the police officers, until the person so arrested can be taken before the proper magistrate for hearing and committed to prison or discharged, but no person shall be detained therein for a longer time than twenty-four hours, except upon the order of a magistrate legally authorized, who may commit such person for further hearing.
53 P.S. § 23121