The plaintiff in any judgment recovered on a tax or municipal claim may, upon paying the sheriff's costs, fix an upset price to be realized at any sale under such judgment, sufficient to pay all taxes and municipal claims, and all accrued but unfiled taxes and claims, in full. No sale shall be made on a judgment recovered on a tax or municipal claim except for a sum sufficient to pay all taxes and municipal claims in full, except as hereinafter provided, and the plaintiff in such judgment may purchase the property at such sale, for that sum, if no one bids a higher price therefor, except when a municipality is the real plaintiff in such judgment, and no one else bids a sum sufficient to pay sheriff's costs and all taxes and municipal claims in full, said municipality may purchase the property for the sheriff's costs thereon, subject to the lien of all taxes and municipal claims, and liens not otherwise discharged by the sale under existing law.
Upon a purchase by a municipality for the sheriff's costs, any income received from the property by the municipality in excess of that necessary for the upkeep of said property and the payment of insurance premiums thereon, and the cost of improvements thereto, shall be applied to the payment of the costs of sale, then to payment of all taxes liened and unliened, in the order of their priority, the oldest being paid first, and then to municipal claims in the same order.
53 P.S. § 7279