Changeset 12592 for trunk/wp-admin/press-this.php
- Timestamp:
- 12/31/2009 04:57:54 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/press-this.php
r12546 r12592 13 13 if ( ! current_user_can('edit_posts') ) 14 14 wp_die( __( 'Cheatin’ uh?' ) ); 15 16 /**17 * Convert characters.18 *19 * @package WordPress20 * @subpackage Press_This21 * @since 2.6.022 *23 * @param string $text24 * @return string25 */26 function aposfix($text) {27 $translation_table[chr(34)] = '"';28 $translation_table[chr(38)] = '&';29 $translation_table[chr(39)] = ''';30 return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($text, $translation_table));31 }32 15 33 16 /** … … 93 76 94 77 // Set Variables 95 $title = isset( $_GET['t'] ) ? trim( strip_tags( aposfix( stripslashes( $_GET['t'] ) ) ) ) : ''; 96 $selection = isset( $_GET['s'] ) ? trim( htmlspecialchars( html_entity_decode( aposfix( stripslashes( $_GET['s'] ) ) ) ) ) : ''; 78 $title = isset( $_GET['t'] ) ? trim( strip_tags( html_entity_decode( stripslashes( $_GET['t'] ) , ENT_QUOTES) ) ) : ''; 79 80 $selection = ''; 81 if ( !empty($_GET['s']) ) { 82 $selection = str_replace(''', "'", stripslashes($_GET['s'])); 83 $selection = trim( htmlspecialchars( html_entity_decode($selection, ENT_QUOTES) ) ); 84 } 85 97 86 if ( ! empty($selection) ) { 98 87 $selection = preg_replace('/(\r?\n|\r)/', '</p><p>', $selection); 99 $selection = '<p>' .str_replace('<p></p>', '', $selection).'</p>';88 $selection = '<p>' . str_replace('<p></p>', '', $selection) . '</p>'; 100 89 } 101 90
Note: See TracChangeset
for help on using the changeset viewer.