Notice fixes. Props DD32. see #7509
git-svn-id: http://svn.automattic.com/wordpress/trunk@9714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
47a824081a
commit
86702a2520
|
@ -24,7 +24,6 @@ if ( ! defined('ABSPATH') ) die();
|
|||
<tbody id="the-list" class="list:post">
|
||||
<?php
|
||||
if ( have_posts() ) {
|
||||
$bgcolor = '';
|
||||
add_filter('the_title','wp_specialchars');
|
||||
while (have_posts()) : the_post();
|
||||
$alt = ( 'alternate' == $alt ) ? '' : 'alternate';
|
||||
|
@ -200,7 +199,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
|||
endwhile;
|
||||
} else {
|
||||
?>
|
||||
<tr style='background-color: <?php echo $bgcolor; ?>'>
|
||||
<tr>
|
||||
<td colspan="8"><?php _e('No posts found.') ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
|
|
@ -1899,7 +1899,8 @@ function &get_page(&$page, $output = OBJECT, $filter = 'raw') {
|
|||
}
|
||||
}
|
||||
|
||||
return get_post($page, $output, $filter);
|
||||
$page = get_post($page, $output, $filter);
|
||||
return $page;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1740,13 +1740,13 @@ class WP_Query {
|
|||
if ( !empty($q['s']) ) {
|
||||
// added slashes screw with quote grouping when done early, so done later
|
||||
$q['s'] = stripslashes($q['s']);
|
||||
if ($q['sentence']) {
|
||||
if ( !empty($q['sentence']) ) {
|
||||
$q['search_terms'] = array($q['s']);
|
||||
} else {
|
||||
preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q[s], $matches);
|
||||
preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q['s'], $matches);
|
||||
$q['search_terms'] = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
|
||||
}
|
||||
$n = ($q['exact']) ? '' : '%';
|
||||
$n = !empty($q['exact']) ? '' : '%';
|
||||
$searchand = '';
|
||||
foreach( (array) $q['search_terms'] as $term) {
|
||||
$term = addslashes_gpc($term);
|
||||
|
@ -1754,7 +1754,7 @@ class WP_Query {
|
|||
$searchand = ' AND ';
|
||||
}
|
||||
$term = $wpdb->escape($q['s']);
|
||||
if (!$q['sentence'] && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
|
||||
if (empty($q['sentence']) && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
|
||||
$search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";
|
||||
|
||||
if ( !empty($search) )
|
||||
|
|
|
@ -538,12 +538,17 @@ endif;
|
|||
function _fetch_remote_file ($url, $headers = "" ) {
|
||||
$resp = wp_remote_request($url, array('headers' => $headers, 'timeout' => MAGPIE_FETCH_TIME_OUT));
|
||||
if ( is_wp_error($resp) ) {
|
||||
$error = array_shift($resp->errors);
|
||||
|
||||
$resp = new stdClass;
|
||||
$resp->status = 500;
|
||||
$resp->response_code = 500;
|
||||
$resp->error = $error[0] . "\n"; //\n = Snoopy compatibility
|
||||
return $resp;
|
||||
}
|
||||
$response = new stdClass;
|
||||
$response->status = $resp['response']['code'];
|
||||
$response->response_code = $resp['response']['code'];
|
||||
$response->headers = $resp['headers'];
|
||||
$response->results = $resp['body'];
|
||||
|
||||
|
|
Loading…
Reference in New Issue