Hotfix patches for SA-CORE-2014-006

From https://www.drupal.org/node/2378765