Barack Obama actually said...
And we can only achieve 'liberty and justice for all' if we live by that one rule at the heart of every religion, including Islam—that we do unto others as we would have them do unto us.
Context
Press Release: Remarks of President Barack Obama at the Iftar Dinner - As Prepared for Delivery
08/12/2010