Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

PD9waHAKCmlmICghZGVmaW5lZCgiRFMiKSkgewogICAgZGVmaW5lKCJEUyIsIERJUkVDVE9SWV9TRVBBUkFUT1IpOw..

Decoded Output download

<?  PD9waHAKCmlmICghZGVmaW5lZCgiRFMiKSkgewogICAgZGVmaW5lKCJEUyIsIERJUkVDVE9SWV9TRVBBUkFUT1IpOwp9CnJlcXVpcmVfb25jZSAiY29yZSIgLiBEUyAuICJCb290c3RyYXAucGhwIjsKaWYgKCFkZWZpbmVkKCJXSE1DUyIpKSB7CiAgICBleGl0KCJUaGlzIGZpbGUgY2Fubm90IGJlIGFjY2Vzc2VkIGRpcmVjdGx5Iik7Cn0KY2xhc3MgaGV0em5lcl9jbG91ZF9zZXJ2ZXJzX2Zvcl93aG1jc19saWNlbnNlXzE2NDhQRE9XcmFwcGVyCnsKICAgIHByaXZhdGUgc3RhdGljICRwZG9Db25uZWN0aW9uID0gTlVMTDsKICAgIHByaXZhdGUgc3RhdGljIGZ1bmN0aW9uIGdldERiQ29ubmVjdGlvbigpCiAgICB7CiAgICAgICAgaWYgKGNsYXNzX2V4aXN0cygiSWxsdW1pbmF0ZVxcRGF0YWJhc2VcXENhcHN1bGVcXE1hbmFnZXIiKSkgewogICAgICAgICAgICByZXR1cm4gSWxsdW1pbmF0ZVxEYXRhYmFzZVxDYXBzdWxlXE1hbmFnZXI6OmNvbm5lY3Rpb24oKS0+Z2V0UGRvKCk7CiAgICAgICAgfQogICAgICAgIGlmIChzZWxmOjokcGRvQ29ubmVjdGlvbiA9PT0gTlVMTCkgewogICAgICAgICAgICBzZWxmOjokcGRvQ29ubmVjdGlvbiA9IHNlbGY6OnNldE5ld0Nvbm5lY3Rpb24oKTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHNlbGY6OiRwZG9Db25uZWN0aW9uOwogICAgfQogICAgcHJpdmF0ZSBzdGF0aWMgZnVuY3Rpb24gc2V0Tm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W1lKSkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCR0aGlzLT5tb2R1bGVOYW1lIC4gIjogVW5hYmxlIHRvIGZpbmQgIiAuICRmaWxlIC4gIiBmaWxlLiBQbGVhc2UgcmVuYW1lIGZpbGUgbGljZW5zZV9SRU5BTUUucGhwIHRvIGxpY2Vuc2UucGhwIik7CiAgICAgICAgfQogICAgICAgIGlmICghZmlsZV9leGlzdHMoJGZpbGUpKSB7CiAgICAgICAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oIlVuYWJsZSB0byBmaW5kICIgLiAkZmlsZSAuICIgZmlsZS4iKTsKICAgICAgICB9CiAgICAgICAgJGtleU5hbWUgPSAkdGhpcy0+bW9kdWxlTmFtZSAuICJfbGljZW5zZWtleSI7CiAgICAgICAgJGNvbnRlbnQgPSBmaWxlX2dldF9jb250ZW50cygkZmlsZSk7CiAgICAgICAgJG1hdGNoZXMgPSBbXTsKICAgICAgICBwcmVnX21hdGNoKCIvIiAuICRrZXlOYW1lIC4gIlxccz89XFxzP1xcXCIoW0EtWmEtejAtOV9dKylcXFwiLyIsICRjb250ZW50LCAkbWF0Y2hlcyk7CiAgICAgICAgJGtleSA9ICRtYXRjaGVzWzFdOwogICAgICAgIGlmICghJGtleSkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCR0aGlzLT5nZXRFcnJvck1lc3NhZ2UoImludmFsaWRfbGljZW5jZV9jb250ZW50IikpOwogICAgICAgIH0KICAgICAgICAkdGhpcy0+bGljZW5zZUtleSA9ICRrZXk7CiAgICAgICAgcmV0dXJuICR0aGlzOwogICAgfQogICAgcHJpdmF0ZSBmdW5jdGlvbiB2YWxpZGF0ZUtleSgpCiAgICB7CiAgICAgICAgJGxvY2FsS2V5ID0gW107CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgJGxvY2FsS2V5ID0gJHRoaXMtPmdldExvY2FsS2V5KCk7CiAgICAgICAgICAgICR0aGlzLT52YWxpZG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ICAgIHRocm93IG5ldyBFeGNlcHRpb24oImludmFsaWQiKTsKICAgICAgICB9CiAgICAgICAgaWYgKCRkYXRhWyJzdGF0dXMiXSA9PSAiQWN0aXZlIikgewogICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICB9CiAgICAgICAgaWYgKCFlbXB0eSgkZGF0YVsiZGVzY3JpcHRpb24iXSkpIHsKICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbigkZGF0YVsiZGVzY3JpcHRpb24iXSk7CiAgICAgICAgfQogICAgICAgIHN3aXRjaCAoJGRhdGFbInN0YXR1cyJdKSB7CiAgICAgICAgICAgIGNhc2UgIkludmFsaWQiOgogICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbigiaW52YWxpZCIpOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgIkV4cGlyZWQiOgogICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbigiZXhwaXJlZCIpOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgIlN1c3BlbmRlZCI6CiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCJleHBpcmVkIik7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oIm5vX2Nvbm5lY3Rpb24iKTsKICAgICAgICB9CiAgICB9CiAgICBwcml2YXRlIGZ1bmN0aW9uIGdldExvY2FsS2V5KCkKICAgIHsKICAgICAgICAka2V5ID0gV0hNQ1NcRGF0YWJhc2VcQ2Fwc3VsZTo6dGFibGUoInRibGNvbmZpZ3VyYXRpb24iKS0+d2hlcmUoInNldHRpbmciLCAkdGhpcy0+bW9kdWxlTmFtZSAuICJfbG9jYWxrZXkiKS0+Zmlyc3QoKTsKICAgICAgICBpZiAoISRrZXkpIHsKICAgICAgICAgICA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KSkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCJpbnZhbGlkX2RvbWFpbiIpOwogICAgICAgIH0KICAgICAgICAkdmFsaWRpcHMgPSBleHBsb2RlKCIsIiwgJGtleVsidmFsaWRpcCJdKTsKICAgICAgICAkdXNlcnNpcCA9ICR0aGlzLT5nZXRJcCgpOwogICAgICAgIGlmICghZW1wdHkoJHVzZXJzaXApICYmICFpbl9hcnJheSgkdXNlcnNpcCwgJHZhbGlkaXBzKSAmJiAkdmFsaWRpcHMpIHsKICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbigiaW52YWxpZF9pcCIpOwogICAgICAgIH0KICAgICAgICAkdmFsaWREaXJlY3RvcnkgPSBleHBsb2RlKCIsIiwgJGtleVsidmFsaWRkaXJlY3RvcnkiXSk7CiAgICAgICAgaWYgKCFpbl9hcnJheSgkdGhpcy0+ZGlyLCAkdmFsaWREaXJlY3RvcnkpKSB7CiAgICAgICAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oImludmFsaWRfZGlyZWN0b3J5Iik7CiAgICAgICAgfQogICAgICAgIHJldHVybiB0cnVlOwogICAgfQogICAgcHJpdmF0ZSBmdW5jdGlvbiBnZXRXaG1jc1ZlcnNpb24oKQogICAgewogICAgICAgIGdsb2JhbCAkQ09ORklHOwogICAgICAgIHJldHVybiAkQ09ORklHWyJWZXJzaW9uIl07CiAgICB9CiAgICBwcml2YXRlIGZ1bmN0aW9uIGdldFdobWNzRG9tYWluKCkKICAgIHsKICAgICAgICBpZiAoIWVtcHR5KCRfU0VSVkVSWyJTRVJWRVJfTkFNRSJdKSkgewogICAgICAgICAgICByZXR1cm4gJF9TRVJWRVJbIlNFUlZFUl9OQU1FIl07CiAgICAgICAgfQogICAgICAgIGdsb2JhbCAkQ09ORklHOwogICAgICAgIHJldHVybiBwYXJzZV91cmwoJENPTkZJR1siU3lzdGVtVVJMIl0sIFBIUF9VUkxfSE9TVCk7CiAgICB9CiAgICBwcml2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mlsZSAuICIgZmlsZS4iKTsKICAgICAgICB9CiAgICAgICAgJGtleU5hbWUgPSAkdGhpcy0+bW9kdWxlTmFtZSAuICJfbGljZW5zZWtleSI7CiAgICAgICAgJGNvbnRlbnQgPSBmaWxlX2dldF9jb250ZW50cygkZmlsZSk7CiAgICAgICAgJG1hdGNoZXMgPSBbXTsKICAgICAgICBwcmVnX21hdGNoKCIvIiAuICRrZXlOYW1lIC4gIlxccz89XFxzP1xcXCIoW0EtWmEtejAtOV9dKylcXFwiLyIsICRjb250ZW50LCAkbWF0Y2hlcyk7CiAgICAgICAgJGtleSA9ICRtYXRjaGVzWzFdOwogICAgICAgIGlmICghJGtleSkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCR0aGlzLT5nZXRFcnJvck1lc3NhZ2UoImludmFsaWRfbGljZW5jZV9jb250ZW50IikpOwogICAgICAgIH0KICAgICAgICAkdGhpcy0+bGljZW5zZUtleSA9ICRrZXk7CiAgICAgICAgcmV0dXJuICR0aGlzOwogICAgfQogICAgcHJpdmF0ZSBmdW5jdGlvbiB2YWxpZGF0ZUtleSgpCiAgICB7CiAgICAgICAgJGxvY2FsS2V5ID0gW107CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgJGxvY2FsS2V5ID0gJHRoaXMtPmdldExvY2FsS2V5KCk7CiAgICAgICAgICAgICR0aGlzLT52YWxpZGF0ZUtleURhdGEoJGxvY2FsS2V5KTsKICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gJGV4KSB7CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAkdGhpcy0+b2J0YWluTGljZW5zZUFuZFN0b3JlKCk7CiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uICRleCkgewogICAgICAgICAgICAgICAgaWYgKCR0aGlzLT5jaGVja0xvY2FsRXhwaXJ5KCRsb2NhbEtleSkpIHsKICAgICAgICAgICAgIC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YXR1cyJdKSB7CiAgICAgICAgICAgIGNhc2UgIkludmFsaWQiOgogICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbigiaW52YWxpZCIpOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgIkV4cGlyZWQiOgogICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbigiZXhwaXJlZCIpOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgIlN1c3BlbmRlZCI6CiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCJleHBpcmVkIik7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oIm5vX2Nvbm5lY3Rpb24iKTsKICAgICAgICB9CiAgICB9CiAgICBwcml2YXRlIGZ1bmN0aW9uIGdldExvY2FsS2V5KCkKICAgIHsKICAgICAgICAka2V5ID0gV0hNQ1NcRGF0YWJhc2VcQ2Fwc3VsZTo6dGFibGUoInRibGNvbmZpZ3VyYXRpb24iKS0+d2hlcmUoInNldHRpbmciLCAkdGhpcy0+bW9kdWxlTmFtZSAuICJfbG9jYWxrZXkiKS0+Zmlyc3QoKTsKICAgICAgICBpZiAoISRrZXkpIHsKICAgICAgICAgICAgcmV0dXJuIFtdOwogICAgICAgIH0KICAgICAgICAkY2lwaGVyID0gImFlcy0xMjgtY2JjIjsKICAgICAgICAkaXYgPSBzdWJzdHIobWQ1KCR0aGlzLT5idWlsZEtleSksIDAsIG9wZW5zc2xfY2lwaGVyX2l2X2xlbmd0aCgkY2lwaGVyKSk7CiAgICAgICAgJGRlY29kZWRLZXkgPSBvcGVuc3NsX2RlY3J5cHQoJGtleS0+dmFsdWUsICRjaXBoZXIsICR0aGlzLT5idWlsZEtleSwgMCwgJGl2KTsKICAgICAgICBpZiAoISRkZWNvZGVkS2V5KSB7Ci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Y2VwdGlvbigiaW52YWxpZF9pcCIpOwogICAgICAgIH0KICAgICAgICAkdmFsaWREaXJlY3RvcnkgPSBleHBsb2RlKCIsIiwgJGtleVsidmFsaWRkaXJlY3RvcnkiXSk7CiAgICAgICAgaWYgKCFpbl9hcnJheSgkdGhpcy0+ZGlyLCAkdmFsaWREaXJlY3RvcnkpKSB7CiAgICAgICAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oImludmFsaWRfZGlyZWN0b3J5Iik7CiAgICAgICAgfQogICAgICAgIHJldHVybiB0cnVlOwogICAgfQogICAgcHJpdmF0ZSBmdW5jdGlvbiBnZXRXaG1jc1ZlcnNpb24oKQogICAgewogICAgICAgIGdsb2JhbCAkQ09ORklHOwogICAgICAgIHJldHVybiAkQ09ORklHWyJWZXJzaW9uIl07CiAgICB9CiAgICBwcml2YXRlIGZ1bmN0aW9uIGdldFdobWNzRG9tYWluKCkKICAgIHsKICAgICAgICBpZiAoIWVtcHR5KCRfU0VSVkVSWyJTRVJWRVJfTkFNRSJdKSkgewogICAgICAgICAgICByZXR1cm4gJF9TRVJWRVJbIlNFUlZFUl9OQU1FIl07CiAgICAgICAgfQogICAgICAgIGdsb2JhbCAkQ09ORklHOwogICAgICAgIHJldHVybiBwYXJzZV91cmwoJENPTkZJR1siU3lzdGVtVVJMIl0sIFBIUF9VUkxfSE9TVCk7CiAgICB9CiAgICBwcml2YXRlIGZ1bmN0aW9uIGdldE1vZHVsZVZlcnNpb24oKQogICAgewogICAgICAgICRtb2R1bGVWZXJzaW9uRmlsZSA9ICR0aGlzLT5kaXIgLiAiL21vZHVsZVZlcnNpb24ucGhwIjsKICAgICAgICAkbW9kdWxlVmVyc2lvbiA9ICIiOwogICAgICAgIGlmIChmaWxlX2V4aXN0cygkbW9kdWxlVmVyc2lvbkZpbGUpKSB7CiAgICAgICAgICAgICRjb250ZW50ID0gZmlsZV9nZXRfY29udGVudHMoJG1vZHVsZVZlcnNpb25GaWxlKTsKICAgICAgICAgICAgcHJlZ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ZWEiLCAkcGFyYW1zKTsKfQpmdW5jdGlvbiBIZXR6bmVyVnBzX01ldHJpY1Byb3ZpZGVyKCRwYXJhbXMpCnsKICAgIHJldHVybiBuZXcgTW9kdWxlc0dhcmRlblxTZXJ2ZXJzXEhldHpuZXJWcHNcQXBwXExpYnNcTWV0cmljc1xNeU1ldHJpY3NQcm92aWRlcigkcGFyYW1zKTsKfQpmdW5jdGlvbiBIZXR6bmVyVnBzX1VzYWdlVXBkYXRlKCRwYXJhbXMpCnsKICAgIHRyeSB7CiAgICAgICAgJGFjdGlvbiA9IG5ldyBNb2R1bGVzR2FyZGVuXFNlcnZlcnNcSGV0em5lclZwc1xBcHBcSGVscGVyc1xVc2FnZVVwZGF0ZSgkcGFyYW1zKTsKICAgICAgICAkYWN0aW9uLT51cGRhdGUoKTsKICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiAkZXgpIHsKICAgICAgICByZXR1cm4gWyJlcnJvciIgPT4gJGV4LT5nZXRNZXNzYWdlKCldOwogICAgfQp9Cgo/Pg==

Function Calls

None

Variables

None

Stats

MD5 a47ddd988c78b6f03ba8886898ff8d03
Eval Count 0
Decode Time 298 ms