Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: native_client_sdk/src/examples/hello_nacl_mounts/example.js

Issue 11887021: [NaCl SDK] Add HTTP mount. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: docs for nacl_mounts.h Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/examples/hello_nacl_mounts/example.js
diff --git a/native_client_sdk/src/examples/hello_nacl_mounts/example.js b/native_client_sdk/src/examples/hello_nacl_mounts/example.js
index c2376eaebb4f78edf1165770a942a1199f500186..c355b4d08a426a9351e8ce4ed3d7868ddad9d492 100644
--- a/native_client_sdk/src/examples/hello_nacl_mounts/example.js
+++ b/native_client_sdk/src/examples/hello_nacl_mounts/example.js
@@ -140,6 +140,14 @@ function startsWith(s, prefix) {
function logMessage(msg) {
var logEl = document.getElementById('log');
+
+ // Perform some basic escaping.
+ msg = msg.replace(/&/g, '&')
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+ .replace(/"/g, '&quot;')
+ .replace(/'/g, '&apos;');
+
logEl.innerHTML += msg + '<br>';
}

Powered by Google App Engine
This is Rietveld 408576698