Muwatta Malik Book 9, Hadith 20
Yahya related to me from Malik from Nafi that Ibn Umar stayed in
Makka for ten nights, shortening the prayer, except when he prayed it
behind an imam, in which case he followed the imam's prayer.
Yahya related to me from Malik from Ibn Shihab from Salim ibn Abdullah that Abdullah ibn Umar used to say, "I pray the prayerof a traveller as long as I am undecided whether to remain somewhere or not, even if I am detained for twelve nights."
Yahya related to me from Malik from Ata al-Khurasani that he heard Said ibn al Musayyab say, "A traveller who has decided to remain somewhere for four nights does the prayer in full."
Malik said, "That is what I prefer most out of what I have heard."
Malik when asked about the prayer of a prisoner, said, "It is the same as the prayer of a person who remains in one place, except if he is travelling."