Hello noel,
I'd like you to do a code review. Please execute
g4 diff -c 11219782
or point your web browser to
http://mondrian/11219782
to review the following code:
Change 11219782 by nigel...@nigeltao-srcgears2 on 2009/05/21 16:16:07 *pending*
In the drag-and-drop manual test, sanitize filenames before passing them
to the elemt.innerHTML setter.
PRESUBMIT=passed
BUG=1868134
R=noel
[email protected]
DELTA=6 (4 added, 0 deleted, 2 changed)
OCL=11219782
Affected files ...
...
//depot/googleclient/gears/opensource/gears/test/manual/drag_and_drop.html#12
edit
6 delta lines: 4 added, 0 deleted, 2 changed
The issue description(s) relevant to this code can be found at:
http://b/issue?id=1868134
Also consider running:
g4 lint -c 11219782
which verifies that the changelist doesn't introduce new style violations.
If you can't do the review, please let me know as soon as possible. During
your review, please ensure that all new code has corresponding unit tests and
that existing unit tests are updated appropriately. Visit
http://www/eng/code_review.html for more information.
This is a semiautomated message from "g4 mail". Complaints or suggestions?
Mail [email protected].
Change 11219782 by nigel...@nigeltao-srcgears2 on 2009/05/21 16:16:07 *pending*
In the drag-and-drop manual test, sanitize filenames before passing them
to the elemt.innerHTML setter.
Affected files ...
...
//depot/googleclient/gears/opensource/gears/test/manual/drag_and_drop.html#12
edit
====
//depot/googleclient/gears/opensource/gears/test/manual/drag_and_drop.html#12 -
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/test/manual/drag_and_drop.html
====
# action=edit type=text
--- googleclient/gears/opensource/gears/test/manual/drag_and_drop.html
2009-05-21 16:12:24.000000000 +1000
+++ googleclient/gears/opensource/gears/test/manual/drag_and_drop.html
2009-05-21 16:12:17.000000000 +1000
@@ -96,6 +96,10 @@
document.getElementById('rejectOutput').innerHTML = ' ';
}
+function sanitize(s) {
+ return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
+}
+
function handleDrop(event) {
dropCount++;
eventCount++;
@@ -107,7 +111,7 @@
if (files) {
for (i = 0; i < files.length; i++) {
var file = files[i];
- s += '<b>' + file.name + '</b> has length <b>' +
+ s += '<b>' + sanitize(file.name) + '</b> has length <b>' +
file.blob.length + '</b>';
var md = desktop.extractMetaData(file.blob);
if (md.imageWidth && md.imageHeight) {
@@ -118,7 +122,7 @@
}
s += 'files.length: <b>' + files.length + '</b>, ';
s += 'totalBytes: <b>' + data.totalBytes + '</b>, ';
- s += 'extensions: <b>' + data.extensions + '</b><br>';
+ s += 'extensions: <b>' + sanitize('' + data.extensions) + '</b><br>';
}
document.getElementById('dropOutput').innerHTML = s;
document.getElementById('rejectOutput').innerHTML = ' ';