An extension to the Brun-Titchmarsh theorem