Skip to content

Commit

Permalink
Merge pull request #11280 from atm-maxime/fix_warning_page_var
Browse files Browse the repository at this point in the history
Fix : avoid warning and uniformize $page var use
  • Loading branch information
eldy committed Jun 2, 2019
2 parents 190cf8a + 6dd01e8 commit 40b212d
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion htdocs/comm/action/list.php
Expand Up @@ -87,7 +87,7 @@
$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)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/action/rapport/index.php
Expand Up @@ -42,7 +42,7 @@
$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";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/paiement.php
Expand Up @@ -817,7 +817,7 @@ function callForResult(imgId)
*/
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 ;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/sociales/document.php
Expand Up @@ -55,7 +55,7 @@
$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;
Expand Down
3 changes: 2 additions & 1 deletion htdocs/compta/tva/document.php
Expand Up @@ -56,9 +56,10 @@
$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;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/facture/paiement.php
Expand Up @@ -753,7 +753,7 @@ function callForResult(imgId)
$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;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/hrm/admin/admin_establishment.php
Expand Up @@ -54,7 +54,7 @@
if (!$sortorder) $sortorder="DESC";
if (!$sortfield) $sortfield="e.rowid";

if ($page == -1) {
if (empty($page) || $page == -1) {
$page = 0 ;
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/loan/document.php
Expand Up @@ -47,7 +47,7 @@
$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;
Expand Down
3 changes: 1 addition & 2 deletions htdocs/resource/list.php
Expand Up @@ -97,8 +97,7 @@

$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;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/societe/notify/index.php
Expand Up @@ -42,7 +42,7 @@
$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;
Expand Down

0 comments on commit 40b212d

Please sign in to comment.