On the sorption of gases and liquids in glassy polymers