### Eclipse Workspace Patch 1.0
#P wordpress-tests
|
|
|
59 | 59 | |
60 | 60 | function get_tag( $string, $tag ) { |
61 | 61 | global $wpdb; |
62 | | preg_match("|<$tag.*?>(.*?)</$tag>|is", $string, $return); |
63 | | if ( isset($return[1]) ) { |
64 | | $return = preg_replace('|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1]); |
65 | | $return = $wpdb->escape( trim( $return ) ); |
| 62 | preg_match("@(<$tag.*?><!\[CDATA\[(.*?)\]\]></$tag>|<$tag.*?>(.*?)</$tag>)@is", $string, $return); |
| 63 | if ( !empty($return[2]) ) { |
| 64 | $return = $wpdb->escape( trim( $return[2] ) ); |
| 65 | } else if ( !empty($return[3]) ) { |
| 66 | $return = $wpdb->escape( trim( $return[3] ) ); |
66 | 67 | } else { |
67 | 68 | $return = ''; |
68 | 69 | } |