Skip to content

Commit

Permalink
Bugfix db pagination total, fonts directory in Captcha class is publi…
Browse files Browse the repository at this point in the history
…c and can be changed
  • Loading branch information
oliveira131 committed Nov 18, 2019
1 parent 8332e0b commit 488ac37
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions system/captcha/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Captcha {
protected $perturbation = 0.90;
protected $noise_level = 1;
protected $background = 'black';
public $fonts = __DIR__."/fonts/*/*.ttf";
public $pos = 'ABCDEFGHJKLMNOPQRSTUWVXZ0123456789abcdefhijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUWVXZ0123456789';

function __construct($width = NULL, $height = NULL, $numChar = 6, $background = 'black') {
Expand All @@ -31,8 +32,6 @@ function __construct($width = NULL, $height = NULL, $numChar = 6, $background =
$this->width = ($width != NULL) ? $width : $this->width;
$this->height = ($height != NULL) ? $height : $this->height;

$this->ttfFonts = glob(__DIR__."/fonts/*/*.ttf");

}

public function __help() {
Expand Down Expand Up @@ -125,8 +124,9 @@ function showImage($format = 'png') {
imagefilledrectangle($image, $width - 1, 0, $width - 1, $height - 1, $black);
imagefilledrectangle($image, 0, 0, 0, $height - 1, $black);
imagefilledrectangle($image, 0, $height - 1, $width, $height - 1, $black);



$this->ttfFonts = glob($this->fonts);

$space = ($this->width - 10) / $this->numChar;

Expand Down
Binary file removed system/captcha/fonts/party-time/Party Time.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions system/database/library/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ public function pagination($sql, $pageNum_exibe = 1, $maxRows_exibe = 10, $cache
$all_exibe = $this->query($all_exibe_query, $cache);
$totalRows_exibe = (isset($all_exibe->row['__TOTALdeREG_DB_Pagination'])) ? $all_exibe->row['__TOTALdeREG_DB_Pagination'] : $all_exibe->num_rows;

if($totalRows_exibe <= 0){
$all_exibe_query = $query_exibe;
$all_exibe = $this->query($all_exibe_query, $cache);
$totalRows_exibe = (isset($all_exibe->row['__TOTALdeREG_DB_Pagination'])) ? $all_exibe->row['__TOTALdeREG_DB_Pagination'] : $all_exibe->num_rows;
}

$totalPages_exibe = ceil($totalRows_exibe/$maxRows_exibe);

$exibe->totalPages_exibe = $totalPages_exibe;
Expand Down
2 changes: 1 addition & 1 deletion system/engine/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.2
1.4.3

0 comments on commit 488ac37

Please sign in to comment.