This file contains hidden or 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 | |
function rkv_login_stringcheck() | |
{ | |
global $pagenow; | |
if ( $pagenow == 'wp-login.php' ) | |
{ | |
// set the location a failed attempt goes to | |
$redirect = 'http://www.google.com/'; | |
// missing query string all together |
This file contains hidden or 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
70c70 | |
< $rows = $wpdb->get_results( $wpdb->prepare( "SELECT {$wpdb->prefix}redirection_modules.name AS module_name,{$wpdb->prefix}redirection_groups.name AS group_name,{$wpdb->prefix}redirection_groups.id FROM {$wpdb->prefix}redirection_groups INNER JOIN {$wpdb->prefix}redirection_modules ON {$wpdb->prefix}redirection_modules.id={$wpdb->prefix}redirection_groups.module_id ORDER BY {$wpdb->prefix}redirection_modules.name,{$wpdb->prefix}redirection_groups.position" ) ); | |
--- | |
> $rows = $wpdb->get_results( "SELECT {$wpdb->prefix}redirection_modules.name AS module_name,{$wpdb->prefix}redirection_groups.name AS group_name,{$wpdb->prefix}redirection_groups.id FROM {$wpdb->prefix}redirection_groups INNER JOIN {$wpdb->prefix}redirection_modules ON {$wpdb->prefix}redirection_modules.id={$wpdb->prefix}redirection_groups.module_id ORDER BY {$wpdb->prefix}redirection_modules.name,{$wpdb->prefix}redirection_groups.position" ); |
This file contains hidden or 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 | |
// add tag support to pages | |
register_taxonomy_for_object_type( 'post_tag', 'page' ); | |
// add category support to pages | |
register_taxonomy_for_object_type( 'category', 'page' ); |
This file contains hidden or 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 ( is_user_logged_in() && !is_ssl() ) | |
{ | |
$url = get_permalink( get_the_ID() ); | |
$url = str_replace( 'http://', 'https://', $url ); | |
wp_redirect( $url . '?' . http_build_query( $_GET ), 303 ); | |
die; | |
} |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<title>JS Searcher</title> | |
<style type="text/css"> | |
body { font: 14px HelveticaNeue,Helvetica,Arial,Sans-serif; } | |
textarea.code,pre { width:100%;height:100px;margin:1em;padding:1em;border:1px solid #ccc;background:#f7f7f7;font-family:Monaco,Courier,monospace; } | |
#summary { margin: 1em; border-collapse: collapse; border: 1px solid #d7d7d7; } | |
#summary td { border: 1px solid #d7d7d7; padding: .5em; } | |
</style> |
This file contains hidden or 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 | |
$string = file_get_contents( 'some-file.js' ); | |
$pattern = '#/\*\w.+?\*/try{document.+?/\*\w.+?\*/#im'; | |
$clean = preg_replace( $pattern, '', $string ); | |
file_put_contents( 'some-file.js', $clean ); |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<title>PCRE TEST</title> | |
<style type="text/css"> | |
body { font: 14px HelveticaNeue,Helvetica,Arial,Sans-serif; } | |
table { width: 80%; } | |
textarea.code,pre { width:80%;height:100px;margin:1em;padding:1em;border:1px solid #ccc;background:#f7f7f7;font-family:Monaco,Courier,monospace; overflow: scroll; } | |
#summary { margin: 1em; border-collapse: collapse; border: 1px solid #d7d7d7; } | |
#summary td { border: 1px solid #d7d7d7; padding: .5em; } |
This file contains hidden or 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 | |
// the post | |
$post = 'This is only a test. Please disregard this message. http://www.warnkenlaw.com'; | |
$actions = array( | |
array( | |
'name' => 'Read Our Blog', | |
'link' => 'http://www.facebook.com' | |
) | |
); |
This file contains hidden or 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 | |
/* | |
original version's Line 70 | |
*/ | |
$rows = $wpdb->get_results( $wpdb->prepare( "SELECT {$wpdb->prefix}redirection_modules.name AS module_name,{$wpdb->prefix}redirection_groups.name AS group_name,{$wpdb->prefix}redirection_groups.id FROM {$wpdb->prefix}redirection_groups INNER JOIN {$wpdb->prefix}redirection_modules ON {$wpdb->prefix}redirection_modules.id={$wpdb->prefix}redirection_groups.module_id ORDER BY {$wpdb->prefix}redirection_modules.name,{$wpdb->prefix}redirection_groups.position" ) ); | |
/* | |
Modified version - Line 70 | |
*/ | |
$rows = $wpdb->get_results( "SELECT {$wpdb->prefix}redirection_modules.name AS module_name,{$wpdb->prefix}redirection_groups.name AS group_name,{$wpdb->prefix}redirection_groups.id FROM {$wpdb->prefix}redirection_groups INNER JOIN {$wpdb->prefix}redirection_modules ON {$wpdb->prefix}redirection_modules.id={$wpdb->prefix}redirection_groups.module_id ORDER BY {$wpdb->prefix}redirection_modules.name,{$wpdb->prefix}redirection_groups.position" ); |
This file contains hidden or 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 | |
// user, pass, db name, host | |
$db = new wpdb( 'root', 'password', 'dbname', 'localhost' ); | |
// insert some data | |
if ( $db->insert( 'company_contacts', array( | |
'first_name' => 'Andy', | |
'last_name' => 'Stratton', | |
'email_address' => '[email protected]' | |
)); |