A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 575
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/system/core/Exceptions.php:271)

Filename: view/rss.php

Line Number: 2

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/themes/geocities/views/view/rss.php
Line: 2
Function: header

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 173
Function: include

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 43
Function: _ci_load

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 579
Function: view

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

helper api - Stikked helper api - Stikked http://geopaste.scratchbook.ch/ en hwcrypto.js http://geopaste.scratchbook.ch/view/acc4bc95 Fri, 15 Feb 2019 23:23:46 +0100 login http://geopaste.scratchbook.ch/view/acc4bc95
  1. /*! This is eparaksts-hwcrypto.js 1.2.0 generated on 2017-02-20 */
  2. /* DO NOT EDIT (use src/eparaksts-hwcrypto.js) */
  3. var eparakstshwcrypto = function eparakstshwcrypto() {
  4.     "use strict";
  5.     var consoleDebug = false;
  6.     var _debug = function(x) {
  7.         if (consoleDebug) console.log(x);
  8.     };
  9.     _debug("eparaksts-hwcrypto.js activated");
  10.     window.addEventListener = window.addEventListener || window.attachEvent;
  11.     function hasPluginFor(mime) {
  12.         return navigator.mimeTypes && mime in navigator.mimeTypes;
  13.     }
  14.     function hasExtension(cls) {
  15.         return typeof window[cls] === "function";
  16.     }
  17.     function _hex2array(str) {
  18.         if (typeof str == "string") {
  19.             var len = Math.floor(str.length / 2);
  20.             var ret = new Uint8Array(len);
  21.             for (var i = 0; i < len; i++) {
  22.                 ret[i] = parseInt(str.substr(i * 2, 2), 16);
  23.             }
  24.             return ret;
  25.         }
  26.     }
  27.     function _array2hex(args) {
  28.         var ret = "";
  29.         for (var i = 0; i < args.length; i++) ret += (args[i] < 16 ? "0" : "") + args[i].toString(16);
  30.         return ret.toLowerCase();
  31.     }
  32.     function _mimeid(mime) {
  33.         return "hwc" + mime.replace("/", "").replace("-", "");
  34.     }
  35.     function loadPluginFor(mime) {
  36.         var element = _mimeid(mime);
  37.         if (document.getElementById(element)) {
  38.             _debug("Plugin element already loaded");
  39.             return document.getElementById(element);
  40.         }
  41.         _debug("Loading plugin for " + mime + " into " + element);
  42.         var objectTag = '<object id="' + element + '" type="' + mime + '" style="width: 1px; height: 1px; position: absolute; visibility: hidden;"></object>';
  43.         var div = document.createElement("div");
  44.         div.setAttribute("id", "pluginLocation" + element);
  45.         document.body.appendChild(div);
  46.         document.getElementById("pluginLocation" + element).innerHTML = objectTag;
  47.         return document.getElementById(element);
  48.     }
  49.     var signing_plugin_mime = "application/x-eparaksts";
  50.     var signing_extension = "eParakstsTokenSigning";
  51.     var USER_CANCEL = "user_cancel";
  52.     var NO_CERTIFICATES = "no_certificates";
  53.     var INVALID_ARGUMENT = "invalid_argument";
  54.     var TECHNICAL_ERROR = "technical_error";
  55.     var NO_IMPLEMENTATION = "no_implementation";
  56.     var NOT_ALLOWED = "not_allowed";
  57.     function probe() {
  58.         var msg = "probe() detected ";
  59.         if (hasExtension(signing_extension)) {
  60.             _debug(msg + signing_extension);
  61.         }
  62.         if (hasPluginFor(signing_plugin_mime)) {
  63.             _debug(msg + signing_plugin_mime);
  64.         }
  65.     }
  66.     window.addEventListener("load", function(event) {
  67.         probe();
  68.     });
  69.     function SigningPlugin() {
  70.         this._name = "NPAPI/BHO for " + signing_plugin_mime;
  71.         var p = loadPluginFor(signing_plugin_mime);
  72.         var certificate_ids = {};
  73.         function code2str(err) {
  74.             _debug("Error: " + err + " with: " + p.errorMessage);
  75.             switch (parseInt(err)) {
  76.               case 1:
  77.                 return USER_CANCEL;
  78.  
  79.               case 2:
  80.                 return NO_CERTIFICATES;
  81.  
  82.               case 17:
  83.                 return INVALID_ARGUMENT;
  84.  
  85.               case 19:
  86.                 return NOT_ALLOWED;
  87.  
  88.               default:
  89.                 _debug("Unknown error: " + err + " with: " + p.errorMessage);
  90.                 return TECHNICAL_ERROR;
  91.             }
  92.         }
  93.         function code2err(err) {
  94.             return new Error(code2str(err));
  95.         }
  96.         this.check = function() {
  97.             return new Promise(function(resolve, reject) {
  98.                 setTimeout(function() {
  99.                     resolve(typeof p.version !== "undefined");
  100.                 }, 0);
  101.             });
  102.         };
  103.         this.getVersion = function() {
  104.             return new Promise(function(resolve, reject) {
  105.                 var v = p.version;
  106.                 resolve(v);
  107.             });
  108.         };
  109.         this.getCertificate = function(options) {
  110.             var operation = options.operation || "sign";
  111.             var language = options.lang || "en";
  112.             p.pluginLanguage = language;
  113.             return new Promise(function(resolve, reject) {
  114.                 try {
  115.                     var v;
  116.                     if (typeof p.getCertificateWithOperation !== "undefined") {
  117.                         v = p.getCertificateWithOperation(operation);
  118.                     } else {
  119.                         v = p.getCertificate();
  120.                     }
  121.                     if (parseInt(p.errorCode) !== 0) {
  122.                         reject(code2err(p.errorCode));
  123.                     } else {
  124.                         certificate_ids[v.cert] = v.id;
  125.                         resolve({
  126.                             hex: v.cert
  127.                         });
  128.                     }
  129.                 } catch (ex) {
  130.                     _debug(ex);
  131.                     reject(code2err(p.errorCode));
  132.                 }
  133.             });
  134.         };
  135.         this.sign = function(cert, hash, options) {
  136.             return new Promise(function(resolve, reject) {
  137.                 var cid = certificate_ids[cert.hex];
  138.                 if (cid) {
  139.                     try {
  140.                         var language = options.lang || "en";
  141.                         var operation = options.operation || "sign";
  142.                         var v;
  143.                         if (typeof p.signWithOperation !== "undefined") {
  144.                             v = p.signWithOperation(cid, hash.hex, language, operation);
  145.                         } else {
  146.                             v = p.sign(cid, hash.hex, language);
  147.                         }
  148.                         resolve({
  149.                             hex: v
  150.                         });
  151.                     } catch (ex) {
  152.                         _debug(JSON.stringify(ex));
  153.                         reject(code2err(p.errorCode));
  154.                     }
  155.                 } else {
  156.                     _debug("invalid certificate: " + cert);
  157.                     reject(new Error(INVALID_ARGUMENT));
  158.                 }
  159.             });
  160.         };
  161.     }
  162.     function SigningExtension() {
  163.         this._name = "Native Messaging extension";
  164.         var p = null;
  165.         this.check = function() {
  166.             return new Promise(function(resolve, reject) {
  167.                 if (!hasExtension(signing_extension)) {
  168.                     return resolve(false);
  169.                 }
  170.                 p = new window[signing_extension]();
  171.                 if (p) {
  172.                     resolve(true);
  173.                 } else {
  174.                     resolve(false);
  175.                 }
  176.             });
  177.         };
  178.         this.getVersion = function() {
  179.             return p.getVersion();
  180.         };
  181.         this.getCertificate = function(options) {
  182.             return p.getCertificate(options);
  183.         };
  184.         this.sign = function(cert, hash, options) {
  185.             return p.sign(cert, hash, options);
  186.         };
  187.     }
  188.     function NoBackend() {
  189.         this._name = "No implementation";
  190.         this.check = function() {
  191.             return new Promise(function(resolve, reject) {
  192.                 resolve(true);
  193.             });
  194.         };
  195.         this.getVersion = function() {
  196.             return Promise.reject(new Error(NO_IMPLEMENTATION));
  197.         };
  198.         this.getCertificate = function() {
  199.             return Promise.reject(new Error(NO_IMPLEMENTATION));
  200.         };
  201.         this.sign = function() {
  202.             return Promise.reject(new Error(NO_IMPLEMENTATION));
  203.         };
  204.     }
  205.     var _backend = null;
  206.     var fields = {};
  207.     function _testAndUse(Backend) {
  208.         return new Promise(function(resolve, reject) {
  209.             var b = new Backend();
  210.             b.check().then(function(isLoaded) {
  211.                 if (isLoaded) {
  212.                     _debug("Using backend: " + b._name);
  213.                     _backend = b;
  214.                     resolve(true);
  215.                 } else {
  216.                     _debug(b._name + " check() failed");
  217.                     resolve(false);
  218.                 }
  219.             });
  220.         });
  221.     }
  222.     function _autodetect(force) {
  223.         return new Promise(function(resolve, reject) {
  224.             _debug("Autodetecting best backend");
  225.             if (typeof force === "undefined") {
  226.                 force = false;
  227.             }
  228.             if (_backend !== null && !force) {
  229.                 return resolve(true);
  230.             }
  231.             function trySigningPlugin() {
  232.                 _testAndUse(SigningPlugin).then(function(result) {
  233.                     if (result) {
  234.                         resolve(true);
  235.                     } else {
  236.                         resolve(_testAndUse(NoBackend));
  237.                     }
  238.                 });
  239.             }
  240.             if (navigator.userAgent.indexOf("MSIE") != -1 || navigator.userAgent.indexOf("Trident") != -1) {
  241.                 _debug("Assuming IE BHO, testing");
  242.                 return trySigningPlugin();
  243.             }
  244.             if (hasExtension(signing_extension)) {
  245.                 _testAndUse(SigningExtension).then(function(result) {
  246.                     if (result) {
  247.                         resolve(true);
  248.                     } else {
  249.                         trySigningPlugin();
  250.                     }
  251.                 });
  252.                 return;
  253.             }
  254.             if (hasPluginFor(signing_plugin_mime)) {
  255.                 return trySigningPlugin();
  256.             }
  257.             resolve(_testAndUse(NoBackend));
  258.         });
  259.     }
  260.     fields.use = function(backend) {
  261.         return new Promise(function(resolve, reject) {
  262.             if (typeof backend === "undefined" || backend === "auto") {
  263.                 _autodetect().then(function(result) {
  264.                     resolve(result);
  265.                 });
  266.             } else {
  267.                 if (backend === "chrome") {
  268.                     resolve(_testAndUse(SigningExtension));
  269.                 } else if (backend === "npapi") {
  270.                     resolve(_testAndUse(SigningPlugin));
  271.                 } else {
  272.                     resolve(false);
  273.                 }
  274.             }
  275.         });
  276.     };
  277.     fields.getBackendInfo = function() {
  278.         return new Promise(function(resolve, reject) {
  279.             _autodetect().then(function(result) {
  280.                 _backend.getVersion().then(function(version) {
  281.                     resolve({
  282.                         type: _backend._name,
  283.                         version: version
  284.                     });
  285.                 }, function(error) {
  286.                     if (hasExtension(signing_extension)) {
  287.                         resolve({
  288.                             type: "FAILING_NATIVE_MESSAGING"
  289.                         });
  290.                     } else if (hasPluginFor(signing_plugin_mime)) {
  291.                         resolve({
  292.                             type: "FAILING_NPAPI"
  293.                         });
  294.                     } else {
  295.                         resolve({
  296.                             type: "NO_IMPLEMENTATION"
  297.                         });
  298.                     }
  299.                 });
  300.             });
  301.         });
  302.     };
  303.     fields.getBackendType = function() {
  304.         return new Promise(function(resolve, reject) {
  305.             _autodetect().then(function(result) {
  306.                 _backend.getVersion().then(function(version) {
  307.                     resolve(_backend._name);
  308.                 }, function(error) {
  309.                     if (hasExtension(signing_extension)) {
  310.                         resolve("FAILING_NATIVE_MESSAGING");
  311.                     } else if (hasPluginFor(signing_plugin_mime)) {
  312.                         resolve("FAILING_NPAPI");
  313.                     } else {
  314.                         resolve("NO_IMPLEMENTATION");
  315.                     }
  316.                 });
  317.             });
  318.         });
  319.     };
  320.     fields.setConsoleDebug = function(x) {
  321.         consoleDebug = x;
  322.     };
  323.     fields.debug = function() {
  324.         return new Promise(function(resolve, reject) {
  325.             var hwversion = "eparakstshwcrypto 1.2.0";
  326.             _autodetect().then(function(result) {
  327.                 _backend.getVersion().then(function(version) {
  328.                     resolve(hwversion + " with " + _backend._name + " " + version);
  329.                 }, function(error) {
  330.                     resolve(hwversion + " with failing backend " + _backend._name);
  331.                 });
  332.             });
  333.         });
  334.     };
  335.     fields.getCertificate = function(options) {
  336.         if (typeof options !== "object") {
  337.             _debug("getCertificate options parameter must be an object");
  338.             return Promise.reject(new Error(INVALID_ARGUMENT));
  339.         }
  340.         if (options && !options.operation) {
  341.             options.operation = "sign";
  342.         }
  343.         if (options && !options.lang) {
  344.             options.lang = "en";
  345.         }
  346.         return _autodetect().then(function(result) {
  347.             if (location.protocol !== "https:" && location.protocol !== "file:") {
  348.                 return Promise.reject(new Error(NOT_ALLOWED));
  349.             }
  350.             return _backend.getCertificate(options).then(function(certificate) {
  351.                 if (certificate.hex && !certificate.encoded) certificate.encoded = _hex2array(certificate.hex);
  352.                 return certificate;
  353.             });
  354.         });
  355.     };
  356.     fields.sign = function(cert, hash, options) {
  357.         if (arguments.length < 2) return Promise.reject(new Error(INVALID_ARGUMENT));
  358.         if (options && !options.operation) {
  359.             options.operation = "sign";
  360.         }
  361.         if (options && !options.lang) {
  362.             options.lang = "en";
  363.         }
  364.         if (!hash.type || !hash.value && !hash.hex) return Promise.reject(new Error(INVALID_ARGUMENT));
  365.         if (hash.hex && !hash.value) {
  366.             _debug("DEPRECATED: hash.hex as argument to sign() is deprecated, use hash.value instead");
  367.             hash.value = _hex2array(hash.hex);
  368.         }
  369.         if (hash.value && !hash.hex) hash.hex = _array2hex(hash.value);
  370.         return _autodetect().then(function(result) {
  371.             if (location.protocol !== "https:" && location.protocol !== "file:") {
  372.                 return Promise.reject(new Error(NOT_ALLOWED));
  373.             }
  374.             return _backend.sign(cert, hash, options).then(function(signature) {
  375.                 if (signature.hex && !signature.value) signature.value = _hex2array(signature.hex);
  376.                 return signature;
  377.             });
  378.         });
  379.     };
  380.     fields.NO_IMPLEMENTATION = NO_IMPLEMENTATION;
  381.     fields.USER_CANCEL = USER_CANCEL;
  382.     fields.NOT_ALLOWED = NOT_ALLOWED;
  383.     fields.NO_CERTIFICATES = NO_CERTIFICATES;
  384.     fields.TECHNICAL_ERROR = TECHNICAL_ERROR;
  385.     fields.INVALID_ARGUMENT = INVALID_ARGUMENT;
  386.     return fields;
  387. }();// FIXME: origin unknown
  388. if (!window.atob) {
  389.   var tableStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  390.   var table = tableStr.split("");
  391.  
  392.   window.atob = function (base64) {
  393.     if (/(=[^=]+|={3,})$/.test(base64)) throw new Error("String contains an invalid character");
  394.     base64 = base64.replace(/=/g, "");
  395.     var n = base64.length & 3;
  396.     if (n === 1) throw new Error("String contains an invalid character");
  397.     for (var i = 0, j = 0, len = base64.length / 4, bin = []; i < len; ++i) {
  398.       var a = tableStr.indexOf(base64[j++] || "A"), b = tableStr.indexOf(base64[j++] || "A");
  399.       var c = tableStr.indexOf(base64[j++] || "A"), d = tableStr.indexOf(base64[j++] || "A");
  400.       if ((a | b | c | d) < 0) throw new Error("String contains an invalid character");
  401.       bin[bin.length] = ((a << 2) | (b >> 4)) & 255;
  402.       bin[bin.length] = ((b << 4) | (c >> 2)) & 255;
  403.       bin[bin.length] = ((c << 6) | d) & 255;
  404.     };
  405.     return String.fromCharCode.apply(null, bin).substr(0, bin.length + n - 4);
  406.   };
  407.  
  408.   window.btoa = function (bin) {
  409.     for (var i = 0, j = 0, len = bin.length / 3, base64 = []; i < len; ++i) {
  410.       var a = bin.charCodeAt(j++), b = bin.charCodeAt(j++), c = bin.charCodeAt(j++);
  411.       if ((a | b | c) > 255) throw new Error("String contains an invalid character");
  412.       base64[base64.length] = table[a >> 2] + table[((a << 4) & 63) | (b >> 4)] +
  413.                               (isNaN(b) ? "=" : table[((b << 2) & 63) | (c >> 6)]) +
  414.                               (isNaN(b + c) ? "=" : table[c & 63]);
  415.     }
  416.     return base64.join("");
  417.   };
  418.  
  419. }
  420.  
  421. function hexToBase64(str) {
  422.   return btoa(String.fromCharCode.apply(null,
  423.     str.replace(/\r|\n/g, "").replace(/([\da-fA-F]{2}) ?/g, "0x$1 ").replace(/ +$/, "").split(" "))
  424.   );
  425. }
  426.  
  427. function hexToPem(s) {
  428.    var b = hexToBase64(s);
  429.    var pem = b.match(/.{1,64}/g).join("\n");
  430.    return "-----BEGIN CERTIFICATE-----\n" + pem + "\n-----END CERTIFICATE-----";
  431. }
]]>