Skip to content

Commit

Permalink
fix possible division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
ximex committed Nov 12, 2016
1 parent ec13996 commit 37a5178
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion adm_program/modules/announcements/announcements.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
// number of announcements per page
if($gPreferences['announcements_per_page'] > 0)
{
$announcementsPerPage = $gPreferences['announcements_per_page'];
$announcementsPerPage = (int) $gPreferences['announcements_per_page'];
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion adm_program/modules/dates/dates.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
// Number of events each page for default view 'html' or 'compact' view
if($gPreferences['dates_per_page'] > 0 && $getViewMode === 'html')
{
$datesPerPage = $gPreferences['dates_per_page'];
$datesPerPage = (int) $gPreferences['dates_per_page'];
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion adm_program/modules/guestbook/guestbook.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function toggleDiv(objectId) {
// Anzahl Gaestebucheintraege pro Seite
if($gPreferences['guestbook_entries_per_page'] > 0)
{
$guestbook_entries_per_page = $gPreferences['guestbook_entries_per_page'];
$guestbook_entries_per_page = (int) $gPreferences['guestbook_entries_per_page'];
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion adm_program/modules/links/links.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
// number of weblinks per page
if($gPreferences['weblinks_per_page'] > 0)
{
$weblinksPerPage = $gPreferences['weblinks_per_page'];
$weblinksPerPage = (int) $gPreferences['weblinks_per_page'];
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion adm_program/modules/lists/lists.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@

// If necessary show links to navigate to next and previous recordsets of the query
$base_url = ADMIDIO_URL.FOLDER_MODULES.'/lists/lists.php?cat_id='.$getCatId.'&active_role='.(int) $getActiveRole;
$page->addHtml(admFuncGeneratePagination($base_url, $numberOfRoles, $gPreferences['lists_roles_per_page'], $getStart, true));
$page->addHtml(admFuncGeneratePagination($base_url, $numberOfRoles, (int) $gPreferences['lists_roles_per_page'], $getStart, true));

$page->addHtml('</div>');
$page->show();
6 changes: 3 additions & 3 deletions adm_program/modules/photos/photos.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ class="thumbnail center-block" id="img_'.$actThumbnail.'" src="photo_show.php?ph
// show page navigations through thumbnails
$page->addHtml(admFuncGeneratePagination(
ADMIDIO_URL.FOLDER_MODULES.'/photos/photos.php?pho_id='.$photoAlbum->getValue('pho_id'),
$photoAlbum->getValue('pho_quantity'),
$gPreferences['photo_thumbs_page'],
(int) $photoAlbum->getValue('pho_quantity'),
(int) $gPreferences['photo_thumbs_page'],
$getPhotoNr,
true,
'photo_nr'
Expand Down Expand Up @@ -608,7 +608,7 @@ class="thumbnail" src="'.ADMIDIO_URL.FOLDER_MODULES.'/photos/photo_show.php?pho_

// If necessary show links to navigate to next and previous albums of the query
$base_url = ADMIDIO_URL.FOLDER_MODULES.'/photos/photos.php?pho_id='.$getPhotoId;
$page->addHtml(admFuncGeneratePagination($base_url, $albumsCount, $gPreferences['photo_albums_per_page'], $getStart, true));
$page->addHtml(admFuncGeneratePagination($base_url, $albumsCount, (int) $gPreferences['photo_albums_per_page'], $getStart, true));

// show html of complete page
$page->show();
2 changes: 1 addition & 1 deletion adm_program/system/classes/moduledates.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function getDataSet($startElement = 0, $limit = null)

if ($limit === null)
{
$limit = $gPreferences['dates_per_page'];
$limit = (int) $gPreferences['dates_per_page'];
}

if ($gPreferences['system_show_create_edit'] == 1)
Expand Down

0 comments on commit 37a5178

Please sign in to comment.