Every election heretofore held in any county in this state, which has a population of less than 50,000, according to the last federal decennial census, on the question of the levy of a special tax for public hospital purposes under the Constitution of Alabama, including any amendment thereto, at which election a majority of the votes cast were in favor of the levy of the said tax, but which election was irregular by reason of failure prior to the holding of the election to give notice thereof in a newspaper or by posting in the manner or for the time required by any statute applicable to the election, or because of failure to comply with any other statutory requirement applicable to the election or because of any other irregularity with respect to the holding of the election or canvassing and recording the results thereof, shall be, and every such election is hereby, ratified and confirmed and given effect in all respects as if all provisions of law relating to such election have been duly and legally complied with, and the said tax may be levied and collected pursuant to the authorization purported to have been granted at such election; provided, that this section shall not apply to any election which, prior to July 16, 1962, has been in express terms held illegal by the county commission of the county wherein the election was held, by the Supreme Court of Alabama or by final judgment of the circuit court in the county in which the election was held and from which judgment an appeal was not taken to the Supreme Court of Alabama within the time provided by law for the taking of such appeals or to any election the validity of which is an issue in any pending civil action commenced prior to July 16, 1962.