{"thread":{"id":"10107","subject":"[PATCH] Prevent purely-numeric ref names from breaking Javascript.","startedAt":"2007-10-01T15:37:02Z","lastAt":"2007-10-01T15:37:02Z","messageCount":1,"participants":["David Symonds"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"54492","messageId":"11912530222348-git-send-email-dsymonds@gmail.com","threadId":"10107","inReplyTo":null,"subject":"[PATCH] Prevent purely-numeric ref names from breaking Javascript.","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2007-10-01T15:37:02Z","receivedAt":"2007-10-01T15:37:02Z","isPatch":true,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"When the server reply carrying JSON data to the client browser to render has\na string that looks like a decimal number, it doesn't get quoted. The\nclient-side Javascript code assumes, however, that all the ref names are\nstrings, and so calls string functions on decimal number objects if the ref\nname is purely numeric (e.g. \"2.5\"). This patch simply forces the objects that\nare escaped for HTML presentation to be coerced into strings, which catches\nthis case (and possibly others).\n---\n by-commit.html |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/by-commit.html b/by-commit.html\nindex d759c3e..0aa69b9 100644\n--- a/by-commit.html\n+++ b/by-commit.html\n@@ -35,6 +35,7 @@ format_log_date=function( date )\n }\n escape_html=function( s )\n {\n+\ts=s+\"\";\t// ensure it's a string\n \ts=s.replace( /\\&/g, \"&amp;\" );\n \ts=s.replace( /\\</g, \"&lt;\" );\n \ts=s.replace( /\\>/g, \"&gt;\" );\n-- \n1.5.3.1\n"}]}