§ 767. Order of redemption; liability of persons redeeming. The person redeeming, as prescribed in this article or the owner of the property so redeemed, may present to the court which issued the warrant a petition setting forth the facts of the redemption and praying for an order establishing the rights and liabilities of the parties upon the redemption, whereupon the court must make an order requiring the other party to the redemption to show cause at a time and place therein specified why the prayer of the petition should not be granted. The order to show cause must be made returnable not less than two nor more than ten days after it is granted; and it must be served at least two days before it is returnable. Upon the return thereof, the court must hear the allegations and proofs of the parties and must make such a judgment as justice requires. The costs and expenses must be paid by the petitioner. The judgment, or a certified copy thereof, may be recorded in like manner as a deed. A person, other than the lessee, who redeems as prescribed in this article succeeds to all the duties and liabilities of the lessee accruing after the redemption as if he was named as lessee in the lease.