In any action on a contract or lease entered into after September 21, 1977, where such contract or lease specifically provides that attorney's fees and costs, which are incurred to enforce the provisions of such contract or lease, shall be awarded to one of the parties, the prevailing party, whether he is the party specified in the contract or lease or not, shall be entitled to reasonable attorney's fees in addition to costs and necessary disbursements.
Attorney's fees provided for by this section shall not be subject to waiver by the parties to any contract or lease which is entered into after September 21, 1977. Any provision in any such contract or lease which provides for a waiver of attorney's fees is void.
As used in this section "prevailing party" means the party in whose favor final judgment is rendered.
[1977 ex.s. c 203 § 1.]