Ticket #13782: #13782.patch
| File #13782.patch, 1.8 KB (added by , 16 years ago) |
|---|
-
wp-includes/query.php
1111 1111 var $is_posts_page = false; 1112 1112 1113 1113 /** 1114 * Set if query must be strictly what it is asked to do. 1115 * 1116 * Set if query is strict. 1117 * 1118 * @since 3.x.x 1119 * @access public 1120 * @var bool 1121 */ 1122 var $is_strict = false; 1123 1124 /** 1114 1125 * Resets query flags to false. 1115 1126 * 1116 1127 * The query flags are what page info WordPress was able to figure out. … … 1143 1154 $this->is_singular = false; 1144 1155 $this->is_robots = false; 1145 1156 $this->is_posts_page = false; 1157 $this->is_strict = false; 1146 1158 } 1147 1159 1148 1160 /** … … 1218 1230 , 'preview' 1219 1231 , 's' 1220 1232 , 'sentence' 1233 , 'strict' 1221 1234 ); 1222 1235 1223 1236 foreach ( $keys as $key ) { … … 1282 1295 1283 1296 $qv['attachment_id'] = absint($qv['attachment_id']); 1284 1297 1298 if ( isset($qv['strict']) && $qv['strict'] ) 1299 $this->is_strict = true; 1300 1285 1301 if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) { 1286 1302 $this->is_single = true; 1287 1303 $this->is_attachment = true; … … 1872 1888 1873 1889 if ( empty($q['cat']) || ($q['cat'] == '0') || 1874 1890 // Bypass cat checks if fetching specific posts 1875 $this->is_singular) {1891 ($this->is_singular && !$this->is_strict) ) { 1876 1892 $whichcat = ''; 1877 1893 } else { 1878 1894 $q['cat'] = ''.urldecode($q['cat']).''; … … 1909 1925 } 1910 1926 1911 1927 // Category stuff for nice URLs 1912 if ( '' != $q['category_name'] && !$this->is_singular) {1928 if ( '' != $q['category_name'] && (!$this->is_singular || $this->is_strict) ) { 1913 1929 $q['category_name'] = implode('/', array_map('sanitize_title', explode('/', $q['category_name']))); 1914 1930 $reqcat = get_category_by_path($q['category_name']); 1915 1931 $q['category_name'] = str_replace('%2F', '/', urlencode(urldecode($q['category_name'])));