Ticket #3154: patch.diff
| File patch.diff, 1.9 KB (added by , 20 years ago) |
|---|
-
query.php
329 329 function parse_query_vars() { 330 330 $this->parse_query(''); 331 331 } 332 333 function fill_query_vars($array) { 334 $keys = array( 335 'error' 336 , 'm' 337 , 'p' 338 , 'subpost' 339 , 'subpost_id' 340 , 'attachment' 341 , 'attachment_id' 342 , 'name' 343 , 'hour' 344 , 'static' 345 , 'pagename' 346 , 'page_id' 347 , 'second' 348 , 'minute' 349 , 'hour' 350 , 'day' 351 , 'monthnum' 352 , 'year' 353 , 'w' 354 , 'category_name' 355 , 'author_name' 356 , 'feed' 357 , 'tb' 358 , 'paged' 359 , 'comments_popup' 360 , 'preview' 361 ); 332 362 363 foreach ($keys as $key) { 364 if ( !isset($array[$key])) 365 $array[$key] = ''; 366 } 367 368 return $array; 369 } 370 333 371 // Parse a query string and set query type booleans. 334 372 function parse_query ($query) { 335 373 if ( !empty($query) || !isset($this->query) ) { … … 341 379 $this->query = $query; 342 380 $this->query_vars = $qv; 343 381 } 344 382 383 $qv = $this->fill_query_vars($qv); 384 345 385 if ( ! empty($qv['robots']) ) { 346 386 $this->is_robots = true; 347 387 return; … … 530 570 531 571 // Shorthand. 532 572 $q = &$this->query_vars; 573 574 $q = $this->fill_query_vars($q); 533 575 534 576 // First let's clear some variables 535 577 $distinct = ''; … … 540 582 $where = ''; 541 583 $limits = ''; 542 584 $join = ''; 585 $search = ''; 543 586 544 587 if ( !isset($q['post_type']) ) 545 588 $q['post_type'] = 'post'; … … 909 952 } 910 953 911 954 if (($q['what_to_show'] == 'posts')) { 912 $q['offset'] = abs(intval($q['offset']));913 955 if ( empty($q['offset']) ) { 914 956 $pgstrt = ''; 915 957 $pgstrt = (intval($page) -1) * $q['posts_per_page'] . ', '; 916 958 $limits = 'LIMIT '.$pgstrt.$q['posts_per_page']; 917 959 } else { // we're ignoring $page and using 'offset' 960 $q['offset'] = abs(intval($q['offset'])); 918 961 $pgstrt = $q['offset'] . ', '; 919 962 $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page']; 920 963 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)