Skip to content

Instantly share code, notes, and snippets.

💭
🛩 Running your application

Viktor Szépe szepeviktor

💭
🛩 Running your application
Block or report user

Report or block szepeviktor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@szepeviktor
szepeviktor / phpstan-output.txt
Created Jun 9, 2019
Analysis results of cipherdevgroup/alpha on PHPStan Level 4
View phpstan-output.txt
------ -----------------------------------
Line hooks-template.php
------ -----------------------------------
11 Right side of || is always false.
------ -----------------------------------
------ -----------------------------------
Line hooks.php
------ -----------------------------------
11 Right side of || is always false.
@szepeviktor
szepeviktor / _core-wpdb.php
Last active Jun 9, 2019
Connect to WordPress's global $wpdb instance from a proper class
View _core-wpdb.php
<?php
/**
* This is a gift for Phil.
*
* Usage: $db = new \WordPress\WpDb(); $db->prepare('...');
*/
declare( strict_types = 1 );
namespace WordPress;
@szepeviktor
szepeviktor / gist:bb2e42d928c7561063d14f258c6665ad
Created Jun 3, 2019
PHPStan output for SilverStrip Framework on Level 0
View gist:bb2e42d928c7561063d14f258c6665ad
------ -----------------------------------------------------------------------------
Line Control/Controller.php
------ -----------------------------------------------------------------------------
398 Access to an undefined property SilverStripe\Control\Controller::$template.
------ -----------------------------------------------------------------------------
------ ----------------------------------------------------------------------------------------------------------------------------------------
Line Control/Director.php
------ ----------------------------------------------------------------------------------------------------------------------------------------
71 Property SilverStripe\Control\Director::$current_page has unknown class SilverStripe\CMS\Model\SiteTree as its type.
@szepeviktor
szepeviktor / composer.json
Created May 19, 2019
Static Analysis for WebARX WordPress plugin: composer update --classmap-authoritative && vendor/bin/phpstan analyze
View composer.json
{
"require": {
"php": "~7.1"
},
"require-dev": {
"szepeviktor/phpstan-wordpress": "^0.1.0"
}
}
View harden-global-functions.md

Hello,

Here's a quick and dirty way to slip a backdoor into a PHP project by abusing Namespaces.

POC:

root@ssh:~/underhanded# php index.php SUCCESS

@szepeviktor
szepeviktor / wolt-vega.js
Last active Apr 17, 2019
Wolt vega - az étlap oldalakról eltávolítja a húsételeket
View wolt-vega.js
// ==UserScript==
// @name Wolt vega
// @description Az étlap oldalakról eltávolítja a húsételeket.
// @icon https://static.wolt.com/favicon.ico
// @version 0.2.0
// @grant none
// @run-at document-idle
// @include https://wolt.com/*/*/*/restaurant/*
// ==/UserScript==
@szepeviktor
szepeviktor / tag-factory.php
Created Mar 28, 2019
Tag factory for WordPress
View tag-factory.php
<?php
/**
* Create an HTML element.
*
* @see https://www.w3.org/TR/html/syntax.html#void-elements
*
* @param string $name
* @param array $attrs
* @param string $content
@szepeviktor
szepeviktor / netpincer-vega.js
Last active Mar 3, 2019
Netpincér vega - Az étlap oldalakról eltávolítja a húsételeket.
View netpincer-vega.js
// ==UserScript==
// @name Netpincér vega
// @description Az étlap oldalakról eltávolítja a húsételeket.
// @icon https://www.netpincer.hu/skin/flat/images/favicon.ico
// @version 0.2.2
// @grant none
// @run-at document-idle
// @include https://www.netpincer.hu/*/_etlap
// @include https://www.netpincer.hu/*/etlap
// ==/UserScript==
@szepeviktor
szepeviktor / script-loader.js
Last active May 5, 2019
Mini JavaScript loader
View script-loader.js
<script id="in-head">
/*jslint
browser:true
*/
/**
* Load a script in an asynchronous manner.
* @param {string} uri
* @param {callback} loadCallback
* @param {callback} errorCallback
View www.gstatic.com--wcm--impl-1_31.js
(function () {
var l = this,
n = function (a) {
return "string" == typeof a
},
aa = function (a, b) {
a = a.split(".");
var c = l;
a[0] in c || "undefined" == typeof c.execScript || c.execScript("var " + a[0]);
for (var d; a.length && (d = a.shift());) a.length || void 0 === b ? c[d] && c[d] !== Object.prototype[d] ? c = c[d] : c = c[d] = {} : c[d] = b
You can’t perform that action at this time.