This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @last https://3v4l.org/iSgi8 | |
// @same http://stackoverflow.com/a/34908708/2418655 | |
// Start sample | |
$raw_str = '.....<div></div><script></script>& Weiß Göbel 中文百强网File name %20 %20 %21 %2C Décor \/. /. . z \... y \...... x ./ “This name” is & 462^^ not = that grrrreat -][09]()1234747) საბეჭდი-და-ტიპოგრაფიული'; | |
$fallback_str = 'generated__' . date('Y-m-d_H-m_A'); | |
$bad_extension = '....t&+++a()r.gz[]'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @last https://3v4l.org/0LHkO | |
// Start sample | |
$str = '® ‡ ¼'; | |
echo clean($str, false, false); | |
// End sample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="application/ld+json">{ | |
"@context":"http://schema.org", | |
"@type":"HomeGoodsStore", | |
"name":"Our Store", | |
"legalName":"Our Company", | |
"url":"https://www.ourstore.com/", | |
"sameAs":"http://plus.google.com/99999999999999", | |
"logo":"https://www.ourstore.com/image/logo.png", | |
"photo":"https://www.ourstore.com/image/ourstore.png", | |
"description":"People give us money and we give them GLORIOUS PRODUCTS.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Rewrite client IP based on proxy headers | |
$ip_pool = array( | |
!empty($_SERVER['HTTP_CF_CONNECTING_IP']) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : '', | |
!empty($_SERVER['HTTP_CF_PSEUDO_IPV4']) ? $_SERVER['HTTP_CF_PSEUDO_IPV4'] : '', | |
!empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : '', | |
!empty($_SERVER['HTTP_X_FORWARDED']) ? $_SERVER['HTTP_X_FORWARDED'] : '', | |
!empty($_SERVER['HTTP_FORWARDED_FOR']) ? $_SERVER['HTTP_FORWARDED_FOR'] : '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('addTimestamp')) { | |
function addTimestamp($src, $remote = false, $man_v = '') { | |
if (empty($src)) { | |
return; | |
} elseif ($_SERVER['HTTP_HOST'] === $_SERVER['SERVER_NAME']) { | |
$local_root = $_SERVER['DOCUMENT_ROOT'] . '/'; | |
preg_match('/^([https]+:)?\/\//', $src, $src_proto); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This goes in your log class, for this example we will access it in the view as $this->log->consoled | |
// These call a native platform log method, for this example we will call it $this->write() | |
public function syslog($message, $errlog = false) { | |
syslog(LOG_NOTICE, 'debug: (' . $_SERVER['SERVER_NAME'] . '@' . $_SERVER['SERVER_ADDR'] . ') [INFO] ' . $this->clean($message)); | |
if ($errlog) { | |
$this->write('@System | ' . $message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Dribbler Tarbaby Community v.0.1.0 - Copyright 2013-2014 under GNU/GPL | |
// Original script by Mike ([email protected]) | |
// http://www.stopforumspam.com/forum/viewtopic.php?pid=41173 | |
// | |
// Contributors: | |
// John Darkhorse | |
// Derek Haupin ([email protected]) | |
// | |
// @@ WARNING @@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is part of a product class, this function shalt also be available via route with optional ?search= param | |
// $this->request->get is platform specific, change it to whatever your request wrapper uses | |
public function googlecats($cat_ids = false) { | |
// default format | |
$json = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Exits with a print_r and call trace for debugging | |
// $hidden inits array output into browser console | |
// Backtrace: jurchiks101 at gmail dot com - http://php.net/manual/en/function.debug-backtrace.php#112238 | |
if (!function_exists('x_r')) { | |
function x_r($obj, $exit = true, $return = true, $hidden = false, $console_msg = '') { | |
// include a debug call trace | |
$e = new Exception(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is part of a form class, this function shalt also be available via route with optional ?search= param | |
// password list: https://github.com/danielmiessler/SecLists/blob/master/Passwords/10_million_password_list_top_10000.txt | |
// example: www.example.com/chkpw.php&search=dra would return "dragon" (always returns the first pass found) | |
public function chkpass($password = false, $json = true) { | |
$pool = $output = array(); | |
$pool = file('https://src.creadev.org/apps/pwlist/pwlist.txt', FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); |
OlderNewer