Added back handling of legacy conditions
Fix upgrade.php

Modvars not being initialised properly under upgrade conditions.
Add back old URL.
Merge branch 'extensionvar_compat' into 1.3
Merge branch '1.3'