I've heard it, you've heard it.... you know the quote isn't a direct one from Joseph Smith, so what's the truth?
Here are the references:
"Even this nation will be on the verge of crumbling to pieces and tumbling to the ground and when the Constitution is on the brink of ruin this people will be the staff upon which the nation shall lean and they shall bear the Constitution away from the very verge of destruction." (Joseph Smith Papers, LDS Church Historical Archives, Box 1, March 10, 1844)
Parley P. Pratt wrote in 1841 that the prophet said:
"The government is fallen and needs redeeming. It is guilty of Blood and cannot stand as it now is but will come so near desolation as to hang as it were by a single hair!!!!! Then the servants goes [sic] to the nations of the earth, and gathers the strength of the Lord's house! A mighty army! And this is the redemption of Zion when the saints shall have redeemed that government and reinstated it in all its purity and glory!" (George A. Smith Papers, Church Archives, Box 7, Folder 5, January 21, 1841)
James Burgess recorded in his journal, the notes from a sermon given by Joseph Smith. He wrote that Joseph said:
"The time would come when the constitution and government would hang by a brittle thread and would be ready to fall into other hands but this people the latter-day saints will step forth and save it." (James Burgess Journal, 1818-1904, Church Archives, vol. 1-found among loose sermons)
Orson Hyde is recorded in the Journal of Discourses to have said he heard Joseph teach that:
"The time would come that the Constitution and the country would be in danger of an overthrow and said he, if the constitution be saved at all, it will be by the Elders of this Church. I believe this is about the language as nearly as I can recollect it." (Journal of Discourses 6:150)
Eliza R. Snow said:
"I heard the prophet say, 'The time will come when the government of these United States will be so nearly overthrown through its corruption, that the Constitution will hang as it were by a single hair, and the Latter-day Saints-the Elders of Israel-will step forward to its rescue and save it." (In a Pioneer Day celebration in Ogden in 1871 - Journal History, MSF 143 #28, July 24, 1871)
Jedediah M. Grant, at the time of the threatened invasion of Utah by a federal army, referred to the Prophet's utterance as he addressed a Mormon Battalion gathering in Salt Lake City, February 6, 1855.
"What did the Prophet Joseph say? When the Constitution shall be tottering we shall be the people to save it from the hand of the foe." (Deseret News Weekly, January 19, 1870)
Brigham Young, referred to the prophecy in an address given in 1868. He said:
"It would not be many years before these words come to pass." (Journal of Discourses 12:204
John Taylor repeated the warning a few years later:
"It may be nearer...than some of us think." (Journal of Discourses 25:350)
J. Reuben Clark repeated again in 1942:
"Whether it [the Constitution] shall live or die is now in the balance." (Conference Report - Oct. 1942)
Finally, C.W. Nibley, in General Conference in October of 1923, articulated concerns very clearly:
"Brethren and sisters, let me say in closing that we have it of record, that the prophet Joseph Smith said the time would come when, through secret organizations taking the law into their own hands, not being governed by law or by due process of law, but becoming a law unto themselves, when, by those disintegrating activities, the Constitution of the United States would be so torn and rent asunder, and life and property and peace and security would he held of so little value, that the Constitution would, as it were, hang by a thread. But he never said, so far as I have heard, that that thread would be cut. I believe, with Elder Richards, that this Constitution will be preserved, but it will be preserved very largely in consequence of what the Lord has revealed and what this people, through listening to the Lord and being obedient, will help to bring about, to stabilize and give permanency and effect to the Constitution itself. That also is our mission. That also is what we are here for. I glory in it. I praise God with all my heart and soul that I am a member of it."
Source: About.com Forum