Plus, there's the fact that when Worf encounters the real Martok at the prison camp, Martok says, "Yes, I've heard of you," in response to Worf introducing himself. Surely he'd remember Worf after what happened the previous year.
Agreed, it's implied that Martok was replaced at some point prior to "Way of the Warrior"
Not just implied, but basically said outright. Martok says that he was replaced two years ago in "In Purgatory's Shadow," which would place the exchange in mid-season 3.
Which leads to a possible timeline consistency error. Martok says that he has heard of Worf, which is likely because Worf is comparatively famous in KDF circles as the only Klingon warrior in Starfleet. But it is because of Worf's presence that Martok recognises that Garak must be Garak. Which means he knows that Garak and Worf both live together on DS9, for him to make that association.
The problem there is that both Martok and Tain came to that Dominion prison camp in season 3 -
before Worf ever moved to DS9. So how would either of them know Worf was there, to make the connection to Garak? I doubt anyone from the Dominion was interested in keeping their prisoners up to date with current political or personnel movements in the Alpha/Beta quadrants. And Tain may be an intelligence genius but even he can't know things before they happen.
The only explanation is that other Klingons or Cardassians got captured and dropped into the prison after Martok and Tain did, and knew about it, and told them. We never heard about any Klingons being captured by the Dominion, but that doesn't mean they weren't. Also, Ikat'ika implies he hasn't had any other Klingons as prisoners, except for Martok, when he welcomes Worf there. But I guess maybe the other Klingons had already been killed by Jem'Hadar before Worf arrived. We do definitely see other Cardassians at the prison, but I kind of assumed they were from the Tal Shiar / Obsidian Order fleet, which means they've been there as long as Tain has.
So - possible continuity error. (Also, four paragraphs of analysis teased out of one tiny throwaway line. Yikes.)
Colonel Lovok in the Romulan Tal Shiar ("The Die Is Cast"), Ambassador Krajensky in the Federation Diplomatic Corps ("The Adversary"), and General Martok in the Klingon Defense Force ("Way of the Warrior"). The timeline adds up that they all got into place about the same time. Less than six months after first official contact in "The Jem'Hadar," the Dominion has got high-level agents replaced with changeling infiltrators in three out of the four major galactic powers in the A/B quadrants, and within twelve months has managed to fuck shit up inside all three. By the end of "Way of the Warrior", all four powers are screwed, because of changeling infiltration. That's some damned efficient work by the Dominion, long before open warfare ever broke out.
(It does make one wonder why we never heard about anyone in the Cardassian power structure being replaced by a changeling infiltrator. Maybe they did and we just never found out. It could be that they had someone in place helping to set up the alliance that Dukat later finalised. Or, as someone somewhere else suggested, it may be that the Cardassian infiltrator ironically got killed when the Klingons invaded.)
.