diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index ae411addb25..048308c9c20 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -87,7 +87,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1 || $page == null) { $page = 0 ; } +if (empty($page) || $page == -1) { $page = 0 ; } $offset = $limit * $page ; if (! $sortorder) { diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 7e4108b470b..703d35c8480 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -42,7 +42,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1 || $page == null) { $page = 0 ; } +if (empty($page) || $page == -1) { $page = 0 ; } $offset = $limit * $page ; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="a.datep"; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 805bdbdf79e..4888b758cc1 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -817,7 +817,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie */ if (! GETPOST('action','aZ09')) { - if ($page == -1) $page = 0 ; + if (empty($page) || $page == -1) $page = 0 ; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page ; diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 490dbf3a1fe..36d51ff9f01 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -55,7 +55,7 @@ $result = restrictedArea($user, 'tax', $id, 'chargesociales','charges'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { +if (empty($page) || $page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index b83cad80bdd..1653cc28460 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -56,9 +56,10 @@ $result = restrictedArea($user, 'tax', $id, 'vat','charges'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { +if (empty($page) || $page == -1) { $page = 0; } + $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 57ca70dfa98..3a47b496394 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -753,7 +753,7 @@ if (empty($action)) $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page=GETPOST("page",'int'); - if ($page == -1 || $page == null) { $page = 0 ; } + if (empty($page) || $page == -1) { $page = 0 ; } $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 996ddd58ed3..d28323240dd 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -54,7 +54,7 @@ $sortfield = GETPOST("sortfield"); if (!$sortorder) $sortorder="DESC"; if (!$sortfield) $sortfield="e.rowid"; -if ($page == -1) { +if (empty($page) || $page == -1) { $page = 0 ; } diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index f9d17c563fa..69050a5e10d 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -47,7 +47,7 @@ $result = restrictedArea($user, 'loan', $id, '',''); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { +if (empty($page) || $page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 68f91327f6d..f6e81b89773 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -97,8 +97,7 @@ if (empty($arch)) $arch = 0; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $page = GETPOST("page"); -$page = is_numeric($page) ? $page : 0; -$page = $page == -1 ? 0 : $page; +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/societe/notify/index.php b/htdocs/societe/notify/index.php index 3326e431178..c1d99620b89 100644 --- a/htdocs/societe/notify/index.php +++ b/htdocs/societe/notify/index.php @@ -42,7 +42,7 @@ if ($sortfield == "") $sortfield="s.nom"; } -if ($page == -1 || $page == null) { $page = 0 ; } +if (empty($page) || $page == -1) { $page = 0 ; } $offset = $conf->liste_limit * $page ; $pageprev = $page - 1;