Commit c8c8cc89 authored by Takeshi Yoshino's avatar Takeshi Yoshino Committed by Commit Bot

Revert "NetworkConfig: Escape names before passing to i18n()"

This reverts commit 12325b07.

Reason for revert: Broke linux-chromeos-dbg build. See my comment for the details

Original change's description:
> NetworkConfig: Escape names before passing to i18n()
> 
> i18n() asserts if any unsafe tags are passed to it. We need to
> HTMLEscape any network names passed to i18n().
> 
> Bug: 811562
> Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
> Change-Id: I3112dc2f38b0560d1d6ad9fdde91581f1c498a45
> Reviewed-on: https://chromium-review.googlesource.com/920903
> Reviewed-by: Toni Barzic <tbarzic@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#537108}

TBR=stevenjb@chromium.org,tbarzic@chromium.org

Change-Id: I15e8ea3b7ea7eb4bc45ff9262d0c0176fda4c481
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 811562
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Reviewed-on: https://chromium-review.googlesource.com/923222Reviewed-by: default avatarTakeshi Yoshino <tyoshino@chromium.org>
Commit-Queue: Takeshi Yoshino <tyoshino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537231}
parent 8778659e
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
'<(DEPTH)/ui/webui/resources/cr_elements/cr_dialog/compiled_resources2.gyp:cr_dialog', '<(DEPTH)/ui/webui/resources/cr_elements/cr_dialog/compiled_resources2.gyp:cr_dialog',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:util',
'<(EXTERNS_GYP):networking_private', '<(EXTERNS_GYP):networking_private',
'<(INTERFACES_GYP):networking_private_interface', '<(INTERFACES_GYP):networking_private_interface',
], ],
......
...@@ -100,7 +100,7 @@ Polymer({ ...@@ -100,7 +100,7 @@ Polymer({
getDialogTitle_: function() { getDialogTitle_: function() {
const name = this.networkProperties_.Name; const name = this.networkProperties_.Name;
if (name) if (name)
return this.i18n('internetConfigName', HTMLEscape(name)); return this.i18n('internetConfigName', name);
const type = this.i18n('OncType' + this.networkProperties_.Type); const type = this.i18n('OncType' + this.networkProperties_.Type);
return this.i18n('internetJoinType', type); return this.i18n('internetJoinType', type);
}, },
......
...@@ -138,8 +138,7 @@ Polymer({ ...@@ -138,8 +138,7 @@ Polymer({
*/ */
getExplanation_: function(networkProperties) { getExplanation_: function(networkProperties) {
return this.i18n( return this.i18n(
'tetherConnectionExplanation', 'tetherConnectionExplanation', CrOnc.getNetworkName(networkProperties));
CrOnc.getEscapedNetworkName(networkProperties));
}, },
/** /**
...@@ -150,7 +149,7 @@ Polymer({ ...@@ -150,7 +149,7 @@ Polymer({
getDescriptionTitle_: function(networkProperties) { getDescriptionTitle_: function(networkProperties) {
return this.i18n( return this.i18n(
'tetherConnectionDescriptionTitle', 'tetherConnectionDescriptionTitle',
CrOnc.getEscapedNetworkName(networkProperties)); CrOnc.getNetworkName(networkProperties));
}, },
/** /**
......
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
{ {
'target_name': 'cr_onc_types', 'target_name': 'cr_onc_types',
'dependencies': [ 'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:util',
'<(EXTERNS_GYP):networking_private', '<(EXTERNS_GYP):networking_private',
], ],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'], 'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
......
...@@ -422,15 +422,6 @@ CrOnc.getNetworkName = function(properties) { ...@@ -422,15 +422,6 @@ CrOnc.getNetworkName = function(properties) {
return name; return name;
}; };
/**
* @param {!CrOnc.NetworkProperties|!CrOnc.NetworkStateProperties|undefined}
* properties The ONC network properties or state properties.
* @return {string} The name to display for |network|.
*/
CrOnc.getEscapedNetworkName = function(properties) {
return HTMLEscape(CrOnc.getNetworkName(properties));
};
/** /**
* @param {!CrOnc.NetworkProperties|!CrOnc.NetworkStateProperties|undefined} * @param {!CrOnc.NetworkProperties|!CrOnc.NetworkStateProperties|undefined}
* properties The ONC network properties or state properties. * properties The ONC network properties or state properties.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment