[switchyard] r802 committed - Fixed a problem in SwitchYard_Controller with undefined indexes in the...

0 views
Skip to first unread message

codesite...@google.com

unread,
Oct 16, 2009, 4:52:02 PM10/16/09
to switchy...@googlegroups.com
Revision: 802
Author: intuiworx
Date: Fri Oct 16 13:51:31 2009
Log: Fixed a problem in SwitchYard_Controller with undefined indexes in the
$_REQUEST array for pn & pp when fetching sets. Also went ahead and
filtered this stuff, and set up sane defaults if it ain't set already.
http://code.google.com/p/switchyard/source/detail?r=802

Modified:
/framework/trunk/app/core/SwitchYard_Controller.class.php

=======================================
--- /framework/trunk/app/core/SwitchYard_Controller.class.php Mon Oct 5
18:52:47 2009
+++ /framework/trunk/app/core/SwitchYard_Controller.class.php Fri Oct 16
13:51:31 2009
@@ -123,7 +123,11 @@
if (method_exists($this, $callback)) call_user_func_array(array($this,
$callback), array(&$q));

$set = array();
- $this->pager = new Doctrine_Pager($q, $_REQUEST['pn'], $_REQUEST['pp']);
+ $pn = filter_input(INPUT_GET, 'pn', FILTER_VALIDATE_INT);
+ $pp = filter_input(INPUT_GET, 'pp', FILTER_VALIDATE_INT);
+ if ($pn == null) $pn = 1;
+ if ($pn == null) $pp = 10;
+ $this->pager = new Doctrine_Pager($q, $pn, $pp);
foreach ($this->pager->execute() as $row) $set[] = $row;

$this->view->set('pagination',
SwitchYard_Doctrine::pagerLayout($this->pager,
SwitchYard::link($pager_link)));

Reply all
Reply to author
Forward
0 new messages