Sindbad~EG File Manager

Current Path : /home/infinitibizsol/.trash/node_modules.4/cloudinary/lib/utils/encoding/
Upload File :
Current File : /home/infinitibizsol/.trash/node_modules.4/cloudinary/lib/utils/encoding/smart_escape.js

// Based on CGI::unescape. In addition does not escape / :
// smart_escape = (string) => encodeURIComponent(string).replace(/%3A/g, ":").replace(/%2F/g, "/")
function smart_escape(string, unsafe = /([^a-zA-Z0-9_.\-\/:]+)/g) {
  return string.replace(unsafe, function (match) {
    return match.split("").map(function (c) {
      return "%" + c.charCodeAt(0).toString(16).toUpperCase();
    }).join("");
  });
}

module.exports = smart_escape;

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists