[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/s9e/text-formatter/src/Parser/ -> utils.js (source)

   1  /**
   2  * @param  {!string} str
   3  * @return {!string}
   4  */
   5  function html_entity_decode(str)
   6  {
   7      var b = document.createElement('b');
   8      html_entity_decode = function (str)
   9      {
  10          // We escape left brackets so that we don't inadvertently evaluate some nasty HTML such as
  11          // <img src=... onload=evil() />
  12          b.innerHTML = str.replace(/</g, '&lt;');
  13  
  14          return b.textContent;
  15      };
  16  
  17      return html_entity_decode(str);
  18  }
  19  
  20  /**
  21  * @param  {!string} str
  22  * @return {!string}
  23  */
  24  function htmlspecialchars_compat(str)
  25  {
  26      var t = {
  27          '<' : '&lt;',
  28          '>' : '&gt;',
  29          '&' : '&amp;',
  30          '"' : '&quot;'
  31      };
  32      return str.replace(
  33          /[<>&"]/g,
  34          /**
  35          * @param {!string} c
  36          */
  37          function(c)
  38          {
  39              return t[c];
  40          }
  41      );
  42  }
  43  
  44  /**
  45  * @param  {!string} str
  46  * @return {!string}
  47  */
  48  function htmlspecialchars_noquotes(str)
  49  {
  50      var t = {
  51          '<' : '&lt;',
  52          '>' : '&gt;',
  53          '&' : '&amp;'
  54      };
  55      return str.replace(
  56          /[<>&]/g,
  57          /**
  58          * @param {!string} c
  59          */
  60          function(c)
  61          {
  62              return t[c];
  63          }
  64      );
  65  }
  66  
  67  /**
  68  * @param  {!string} str
  69  * @return {!string}
  70  */
  71  function rawurlencode(str)
  72  {
  73      return encodeURIComponent(str).replace(
  74          /[!'()*]/g,
  75          /**
  76          * @param {!string} c
  77          */
  78          function(c)
  79          {
  80              return '%' + c.charCodeAt(0).toString(16).toUpperCase();
  81          }
  82      );
  83  }
  84  
  85  /**
  86  * @return {!boolean}
  87  */
  88  function returnFalse()
  89  {
  90      return false;
  91  }
  92  
  93  /**
  94  * @return {!boolean}
  95  */
  96  function returnTrue()
  97  {
  98      return true;
  99  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1