Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing autofix for methods starting with jQuery.sap.encode #524

Open
6 tasks
flovogt opened this issue Feb 10, 2025 · 1 comment
Open
6 tasks

Missing autofix for methods starting with jQuery.sap.encode #524

flovogt opened this issue Feb 10, 2025 · 1 comment
Labels
autofix An issue related to the autofix capabilities enhancement New feature or request

Comments

@flovogt
Copy link
Member

flovogt commented Feb 10, 2025

Missing autofix for methods starting with jQuery.sap.encode

Methods starting with jQuery.sap.encode... are deprecated. Therefore an autofix should be offered by UI5 linter.

Deprecated APIs:

  • jQuery.sap.encodeCSS
  • jQuery.sap.encodeJS
  • jQuery.sap.encodeURL
  • jQuery.sap.encodeURLParameters
  • jQuery.sap.encodeHTML
  • jQuery.sap.encodeXML

Deprecated Usage

const myCSS = jQuery.sap.encodeCSS("+");
const myJS = jQuery.sap.encodeJS("\"");
const myURL = jQuery.sap.encodeURL("a/b?c=d&e");
const myURLParameters = jQuery.sap.encodeURLParameters({{a:true, b:"d e"}});
const myHTML = jQuery.sap.encodeHTML("<p>My Text</p>");
const myXML = jQuery.sap.encodeXML("<Text text=\"MyText\" />");

Recommended Usage

sap.ui.define([
   "sap/base/security/encodeCSS",
   "sap/base/security/encodeJS",
   "sap/base/security/encodeURL",
   "sap/base/security/encodeURLParameters", 
   "sap/base/security/encodeXML", 
], (encodeCSS, encodeJS, encodeURL, encodeURLParameters, encodeXML) => {
    const myCSS  = encodeCSS("+");
    const myJS = encodeJS("\"");
    const myURL = encodeURL("a/b?c=d&e");
    const myURLParameters = encodeURLParameters("{{a:true, b:"d e"}}");
    const myHTML = encodeXML("<p>My Text</p>");
    const myXML =  encodeXML("<Text text=\"MyText\" />");
});

Note: jQuery.sap.encodeHTML is replaced by sap/base/security/encodeXML

@flovogt flovogt added autofix An issue related to the autofix capabilities enhancement New feature or request labels Feb 10, 2025
@flovogt
Copy link
Member Author

flovogt commented Feb 10, 2025

Will be implemented in CPOUI5FOUNDATION-990.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autofix An issue related to the autofix capabilities enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant