Skip to content

Commit 3a7e85c

Browse files
committed
Notice fixes. Props DD32. see WordPress#7509
git-svn-id: https://develop.svn.wordpress.org/trunk@9714 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c294b8b commit 3a7e85c

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

wp-admin/edit-attachment-rows.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
<tbody id="the-list" class="list:post">
2525
<?php
2626
if ( have_posts() ) {
27-
$bgcolor = '';
2827
add_filter('the_title','wp_specialchars');
2928
while (have_posts()) : the_post();
3029
$alt = ( 'alternate' == $alt ) ? '' : 'alternate';
@@ -200,7 +199,7 @@
200199
endwhile;
201200
} else {
202201
?>
203-
<tr style='background-color: <?php echo $bgcolor; ?>'>
202+
<tr>
204203
<td colspan="8"><?php _e('No posts found.') ?></td>
205204
</tr>
206205
<?php

wp-includes/post.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,8 @@ function &get_page(&$page, $output = OBJECT, $filter = 'raw') {
18991899
}
19001900
}
19011901

1902-
return get_post($page, $output, $filter);
1902+
$page = get_post($page, $output, $filter);
1903+
return $page;
19031904
}
19041905

19051906
/**

wp-includes/query.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,21 +1740,21 @@ function &get_posts() {
17401740
if ( !empty($q['s']) ) {
17411741
// added slashes screw with quote grouping when done early, so done later
17421742
$q['s'] = stripslashes($q['s']);
1743-
if ($q['sentence']) {
1743+
if ( !empty($q['sentence']) ) {
17441744
$q['search_terms'] = array($q['s']);
17451745
} else {
1746-
preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q[s], $matches);
1746+
preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q['s'], $matches);
17471747
$q['search_terms'] = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
17481748
}
1749-
$n = ($q['exact']) ? '' : '%';
1749+
$n = !empty($q['exact']) ? '' : '%';
17501750
$searchand = '';
17511751
foreach( (array) $q['search_terms'] as $term) {
17521752
$term = addslashes_gpc($term);
17531753
$search .= "{$searchand}(($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}'))";
17541754
$searchand = ' AND ';
17551755
}
17561756
$term = $wpdb->escape($q['s']);
1757-
if (!$q['sentence'] && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
1757+
if (empty($q['sentence']) && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
17581758
$search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";
17591759

17601760
if ( !empty($search) )

wp-includes/rss.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,12 +538,17 @@ function fetch_rss ($url) {
538538
function _fetch_remote_file ($url, $headers = "" ) {
539539
$resp = wp_remote_request($url, array('headers' => $headers, 'timeout' => MAGPIE_FETCH_TIME_OUT));
540540
if ( is_wp_error($resp) ) {
541+
$error = array_shift($resp->errors);
542+
541543
$resp = new stdClass;
542544
$resp->status = 500;
545+
$resp->response_code = 500;
546+
$resp->error = $error[0] . "\n"; //\n = Snoopy compatibility
543547
return $resp;
544548
}
545549
$response = new stdClass;
546550
$response->status = $resp['response']['code'];
551+
$response->response_code = $resp['response']['code'];
547552
$response->headers = $resp['headers'];
548553
$response->results = $resp['body'];
549554

0 commit comments

Comments
 (0)