The enemy of my enemy is my friend.
But, after ten seconds of fact checking, they're not the Taliban... They're Afghan Mujahideen.
And the quote was in reference to the Contras.
But who cares about those pesky little 'facts' that pop up when you're making a funny picture to put on the internet, right?