Fix security check in ScriptController::canAccessFromCurrentOrigin()