Skip to content

Instantly share code, notes, and snippets.

View ryanhellyer's full-sized avatar

Ryan Hellyer ryanhellyer

View GitHub Profile
@ryanhellyer
ryanhellyer / simple-colorbox-settings
Created September 10, 2012 17:27
Simple Colorbox settings
<?php
define( 'SIMPLECOLORBOX_THEME', 5 ); // Can choose from 1, 2, 3, 4 or 5
define( 'SIMPLECOLORBOX_OPACITY', 0.6 ); // Background opacity (0 to 1)
define( 'SIMPLECOLORBOX_WIDTH', 90 ); // Colorbox width (0 to 100%)
define( 'SIMPLECOLORBOX_HEIGHT', 90 ); // Colorbox height (0 to 100%)
define( 'SIMPLECOLORBOX_SLIDESHOW', null ); // Colorbox width (0 to 100%)Setting this to null will remove the slideshow
?>
@ryanhellyer
ryanhellyer / get_request_flaw
Created October 7, 2012 13:55
$_GET vulnerability
<form role="search" method="get" id="searchform" action="" >
<label class="screen-reader-text" for="s">Search for:</label>
<input type="text" value="<?php echo $_GET['s']; ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</form>
@ryanhellyer
ryanhellyer / search_query
Created October 7, 2012 14:01
Search query
<form role="search" method="get" id="searchform" action="" >
<label class="screen-reader-text" for="s">Search for:</label>
<input type="text" value="<?php echo esc_attr( $_GET['s'] ); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</form>
@ryanhellyer
ryanhellyer / Search_query_via_api
Created October 7, 2012 14:02
Search query via API
<form role="search" method="get" id="searchform" action="" >
<label class="screen-reader-text" for="s">Search for:</label>
<input type="text" value="<?php echo get_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</form>
@ryanhellyer
ryanhellyer / raw_post_option_update
Created October 7, 2012 14:03
Raw post option update
<?php
$data = $_POST['data'];
update_option( 'some_data', $data );
?>
@ryanhellyer
ryanhellyer / integer_option_update
Created October 7, 2012 14:03
Integer option update
<?php
$data = (int) $_POST['data'];
update_option( 'some_data', $data );
?>
@ryanhellyer
ryanhellyer / kses_update_option
Created October 7, 2012 14:05
kses update option
<?php
$data = wp_kses( $_POST['data'], '', '' );
update_option( 'some_data', $data );
?>
@ryanhellyer
ryanhellyer / inappropriate_php_self
Created October 7, 2012 14:05
Inappropriate use of PHP_SELF in form
<form action="<?php echo $_SERVER['PHP_SELF']; ?>">
@ryanhellyer
ryanhellyer / inappropriate_php_self_link
Created October 7, 2012 14:06
Inappropriate use of PHP_SELF in link
@ryanhellyer
ryanhellyer / sanitized_php_self_form
Created October 7, 2012 14:06
Sanitized php_self form
<form action="<?php echo esc_url( $_SERVER['PHP_SELF'] ); ?>">