!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

/home/cp949260/public_html/phbcoop.com/phb_admin/bower_components/blueimp-tmpl/test/   drwxr-xr-x
Free 233.33 GB of 981.82 GB (23.77%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test.js (5.84 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 * JavaScript Templates Test
 * https://github.com/blueimp/JavaScript-Templates
 *
 * Copyright 2011, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * https://opensource.org/licenses/MIT
 */

/* global beforeEach, afterEach, describe, it */

;(function (context, expect, tmpl) {
  'use strict'

  if (context.require === undefined) {
    // Override the template loading method:
    tmpl.load = function (id) {
      switch (id) {
        case 'template':
          return '{%=o.value%}'
      }
    }
  }

  var data

  beforeEach(function () {
    // Initialize the sample data:
    data = {
      value: 'value',
      nullValue: null,
      falseValue: false,
      zeroValue: 0,
      special: '<>&"\'\x00',
      list: [1, 2, 3, 4, 5],
      func: function () {
        return this.value
      },
      deep: {
        value: 'value'
      }
    }
  })

  afterEach(function () {
    // Purge the template cache:
    tmpl.cache = {}
  })

  describe('Template loading', function () {
    it('String template', function () {
      expect(tmpl('{%=o.value%}', data)).to.equal('value')
    })

    it('Load template by id', function () {
      expect(tmpl('template', data)).to.equal('value')
    })

    it('Retun function when called without data parameter', function () {
      expect(tmpl('{%=o.value%}')(data)).to.equal('value')
    })

    it('Cache templates loaded by id', function () {
      tmpl('template')
      expect(tmpl.cache.template).to.be.a('function')
    })
  })

  describe('Interpolation', function () {
    it('Escape HTML special characters with {%=o.prop%}', function () {
      expect(tmpl('{%=o.special%}', data)).to.equal('&lt;&gt;&amp;&quot;&#39;')
    })

    it('Allow HTML special characters with {%#o.prop%}', function () {
      expect(tmpl('{%#o.special%}', data)).to.equal('<>&"\'\x00')
    })

    it('Function call', function () {
      expect(tmpl('{%=o.func()%}', data)).to.equal('value')
    })

    it('Dot notation', function () {
      expect(tmpl('{%=o.deep.value%}', data)).to.equal('value')
    })

    it('Handle single quotes', function () {
      expect(tmpl("'single quotes'{%=\": '\"%}", data)).to.equal(
        "'single quotes': &#39;"
      )
    })

    it('Handle double quotes', function () {
      expect(tmpl('"double quotes"{%=": \\""%}', data)).to.equal(
        '"double quotes": &quot;'
      )
    })

    it('Handle backslashes', function () {
      expect(tmpl('\\backslashes\\{%=": \\\\"%}', data)).to.equal(
        '\\backslashes\\: \\'
      )
    })

    it('Interpolate escaped falsy values except undefined or null', function () {
      expect(
        tmpl(
          '{%=o.undefinedValue%}' +
            '{%=o.nullValue%}' +
            '{%=o.falseValue%}' +
            '{%=o.zeroValue%}',
          data
        )
      ).to.equal('false0')
    })

    it('Interpolate unescaped falsy values except undefined or null', function () {
      expect(
        tmpl(
          '{%#o.undefinedValue%}' +
            '{%#o.nullValue%}' +
            '{%#o.falseValue%}' +
            '{%#o.zeroValue%}',
          data
        )
      ).to.equal('false0')
    })

    it('Preserve whitespace', function () {
      expect(tmpl('\n\r\t{%=o.value%}  \n\r\t{%=o.value%}  ', data)).to.equal(
        '\n\r\tvalue  \n\r\tvalue  '
      )
    })
  })

  describe('Evaluation', function () {
    it('Escape HTML special characters with print(data)', function () {
      expect(tmpl('{% print(o.special); %}', data)).to.equal(
        '&lt;&gt;&amp;&quot;&#39;'
      )
    })

    it('Allow HTML special characters with print(data, true)', function () {
      expect(tmpl('{% print(o.special, true); %}', data)).to.equal('<>&"\'\x00')
    })

    it('Print out escaped falsy values except undefined or null', function () {
      expect(
        tmpl(
          '{% print(o.undefinedValue); %}' +
            '{% print(o.nullValue); %}' +
            '{% print(o.falseValue); %}' +
            '{% print(o.zeroValue); %}',
          data
        )
      ).to.equal('false0')
    })

    it('Print out unescaped falsy values except undefined or null', function () {
      expect(
        tmpl(
          '{% print(o.undefinedValue, true); %}' +
            '{% print(o.nullValue, true); %}' +
            '{% print(o.falseValue, true); %}' +
            '{% print(o.zeroValue, true); %}',
          data
        )
      ).to.equal('false0')
    })

    it('Include template', function () {
      expect(
        tmpl('{% include("template", {value: "value"}); %}', data)
      ).to.equal('value')
    })

    it('If condition', function () {
      expect(
        tmpl('{% if (o.value) { %}true{% } else { %}false{% } %}', data)
      ).to.equal('true')
    })

    it('Else condition', function () {
      expect(
        tmpl(
          '{% if (o.undefinedValue) { %}false{% } else { %}true{% } %}',
          data
        )
      ).to.equal('true')
    })

    it('For loop', function () {
      expect(
        tmpl(
          '{% for (var i=0; i<o.list.length; i++) { %}' +
            '{%=o.list[i]%}{% } %}',
          data
        )
      ).to.equal('12345')
    })

    it('For loop print call', function () {
      expect(
        tmpl(
          '{% for (var i=0; i<o.list.length; i++) {' + 'print(o.list[i]);} %}',
          data
        )
      ).to.equal('12345')
    })

    it('For loop include template', function () {
      expect(
        tmpl(
          '{% for (var i=0; i<o.list.length; i++) {' +
            'include("template", {value: o.list[i]});} %}',
          data
        ).replace(/[\r\n]/g, '')
      ).to.equal('12345')
    })

    it('Modulo operator', function () {
      expect(
        tmpl(
          '{% if (o.list.length % 5 === 0) { %}5 list items{% } %}',
          data
        ).replace(/[\r\n]/g, '')
      ).to.equal('5 list items')
    })
  })
})(
  this,
  (this.chai || require('chai')).expect,
  this.tmpl || require('../js/tmpl')
)

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0336 ]--