Strip HTML tags from a string. Does not use (much) regex.
Never loads any resources (<img>
, <script>
, etc.) referenced in the input.
The treatment of whitespace is probably consistent across browsers but is not guaranteed.
Technique
<?php | |
if ( $_POST ) { | |
var_dump( $_POST, $_FILES ); | |
exit; | |
} | |
?> | |
<!DOCTYPE html> | |
<html> |
#!/bin/bash | |
# Approximates the phase of the moon using a known new-moon time and a fixed lunar phase of 2551443 seconds. | |
# Outputs the phase as an emoji in UTF-8 | |
CHARS=( | |
"\xf0\x9f\x8c\x91" # 0 - NEW | |
"\xf0\x9f\x8c\x91" # 1 - NEW | |
"\xf0\x9f\x8c\x92" # 2 - WAXING CRESCENT |
#!/usr/bin/env python | |
import socket | |
import threading | |
import select | |
import SocketServer | |
class TCPServer( SocketServer.TCPServer ): | |
allow_reuse_address = True |
#!/bin/bash | |
uparrow=$'\x1b[A' | |
downarrow=$'\x1b[B' | |
leftarrow=$'\x1b[D' | |
rightarrow=$'\x1b[C' | |
read -s -n3 -p "Hit an arrow key: " x | |
case "$x" in |
#!/bin/bash | |
ENTER=$(printf "%b" "\n") | |
ESCAPE=$(printf "%b" "\e") | |
UP_SUFFIX="A" | |
DOWN_SUFFIX="B" | |
RIGHT_SUFFIX="C" | |
LEFT_SUFFIX="D" | |
while true; do |
Index: easy-adsense-lite.php | |
=================================================================== | |
--- easy-adsense-lite.php (revision 638198) | |
+++ easy-adsense-lite.php (working copy) | |
@@ -402,6 +402,8 @@ | |
} | |
function ezAdSense_content($content) { | |
+ global $wp_current_filter; | |
+ if (in_array('get_the_excerpt', (array) $wp_current_filter)) return $content ; |
Index: easy-adsense-lite.php | |
=================================================================== | |
--- easy-adsense-lite.php (revision 638198) | |
+++ easy-adsense-lite.php (working copy) | |
@@ -402,6 +402,7 @@ | |
} | |
function ezAdSense_content($content) { | |
+ if (!in_the_loop()) return $content ; | |
if (!$this->options['allow_feeds'] && is_feed()) return $content ; |
Index: powerpress.php | |
=================================================================== | |
--- powerpress.php (revision 638166) | |
+++ powerpress.php (working copy) | |
@@ -101,8 +101,12 @@ | |
function powerpress_content($content) | |
{ | |
- global $post, $g_powerpress_excerpt_post_id; | |
- |
<?php | |
/* | |
* Plugin Name: I Already Load jQuery "Manually" Hack | |
* Plugin URI: https://gist.github.com/2951506 | |
* Description: If you already load jQuery manually (i.e., without using WordPress' script API), this plugin will prevent other plugins that *do* use WordPress' script API from "double" loadin jQuery. There are probably better ways to prevent this unwanted double-loading behavior. If you have to use this plugin, you're probably doing_it_wrong(). Use at your own risk, it probably breaks something. | |
* Author: mdawaffe | |
* Version: 0.1 | |
* Author URI: http://blogwaffe.com | |
* License: GPL2+ |