Changeset 9410 for trunk/src/bp-core/bp-core-functions.php
- Timestamp:
- 01/29/2015 03:36:16 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r9351 r9410 266 266 // Return the parsed results 267 267 return $r; 268 } 269 270 /** 271 * Sanitizes a pagination argument based on both the request override and the 272 * original value submitted via a query argument, likely to a template class 273 * responsible for limiting the resultset of a template loop. 274 * 275 * @since BuddyPress (2.2.0) 276 * 277 * @param string $page_arg The $_REQUEST argument to look for 278 * @param int $page The original page value to fall back to 279 * @return int A sanitized integer value, good for pagination 280 */ 281 function bp_sanitize_pagination_arg( $page_arg = '', $page = 1 ) { 282 283 // Check if request overrides exist 284 if ( isset( $_REQUEST[ $page_arg ] ) ) { 285 286 // Get the absolute integer value of the override 287 $int = absint( $_REQUEST[ $page_arg ] ); 288 289 // If override is 0, do not use it. This prevents unlimited result sets. 290 // @see https://buddypress.trac.wordpress.org/ticket/5796 291 if ( $int ) { 292 $page = intval( $int ); 293 } 294 } 295 296 return $page; 268 297 } 269 298
Note: See TracChangeset
for help on using the changeset viewer.