In the case of a tenant whose right of possession is not paramount to that of such purchasers, the latter shall be entitled to recover rent from the date of delivery of their deed, except for such fractional part of a quarter as the tenant, if a farmer or engaged in raising crops or produce, or such fractional part of a month in other cases, as the tenant may, in accordance with the terms of his letting, have paid as an advance payment, prior to the date of delivery of said deed. In the case of a tenant whose right of possession is paramount to that of said purchasers, advance rent, paid prior to the date of delivery of petitioner's deed, shall be deemed properly paid, though paid prior to its due date, unless it is so paid with the actual notice of the pendency of the proceedings resulting in the sale, or with intent to defeat the rights of a purchaser thereat.
68 P.S. § 341