copied from vendor branch /vendors/advpoll/current (2009-04-24)
