Story highlights The president signs emergency legislation

The loophole opened when an appeals court struck down part of Ireland's drug law

(CNN) Well, it was weird while it lasted.

On Wednesday, lawmakers in Ireland rushed to close a loophole that temporarily made it legal to possess Ecstasy, crystal methamphetamine, ketamine, magic mushrooms and a host of other recreational drugs.

The loophole was inadvertently opened the day before, when an appeals court invalidated one section of the Misuse of Drugs Act 1977.

The court ruled that Irish governments had been unconstitutionally adding substances to Section 2 of the law for decades.

"We prepared for this possibility. Legislation was prepared and approved in advance by Cabinet," Minister for Health Leo Varadkar said in a written statement. "The emergency legislation ... will re-instate the status quo ante and re-control all drugs that were controlled prior to this judgment."

Read More