Imran Khan granted extended bail by Pakistan court in terrorism case