Skip to content

Commit

Permalink
Refactoring to avoid double md5($uniqueid)
Browse files Browse the repository at this point in the history
  • Loading branch information
semteacher committed Nov 29, 2023
1 parent 070c8fc commit 8ff46cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion classes/output/demo.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
use renderer_base;
use templatable;


define('TABLE1NAME', get_string('table1name', 'local_wunderbyte_table'));
define('TABLE2NAME', get_string('table2name', 'local_wunderbyte_table'));
define('TABLE3NAME', get_string('table3name', 'local_wunderbyte_table'));
Expand Down
5 changes: 2 additions & 3 deletions classes/wunderbyte_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,9 @@ class wunderbyte_table extends table_sql {
*/
public function __construct($uniqueid) {

$uniqueid = md5($uniqueid); // Must to avoid unwanted symbols especially spaces, etc.
parent::__construct($uniqueid);

$this->idstring = md5($uniqueid);
parent::__construct($this->idstring);

$this->classname = get_class($this);

// This unsets the eventual memory of sorting in session to apply the default sorting on load as defined.
Expand Down

0 comments on commit 8ff46cc

Please sign in to comment.