UAE law relating to drugs has undergone significant change, the most notable factor being a slight reduction in punishment for some first-time offenders. The options to commit the accused to a rehabilitation center can be sought providing the offender has good counsel to represent their case with other possible judgments including fines and community service.
Of course, receiving a jail sentence remains a very real possibility although a move towards sentences of 2 years rather than 4 appears to be the norm.
It is prudent to remember that, despite these changes, UAE law is very strict when it comes to drugs, and is considered a criminal act. This extends to prescription drugs and is not limited to recreational ones. Be sure to check that any medication you have been prescribed in your home country is not a banned substance in the UAE and always keep your prescription to hand.