KUALA LUMPUR: A weak earthquake with a magnitude of 3.4 was detected in Temenggor near Gerik, Perak, around midnight yesterday.