"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/action/hashid.php" between
wacko.6.1.14.zip and wacko.6.1.15.zip

About: WackoWiki is a multilingual Wiki-engine that supports WYTIWYG-editing, page rights (ACLs), design themes (skins), file upload, email notification and much more.

hashid.php  (wacko.6.1.14):hashid.php  (wacko.6.1.15)
<?php <?php
if (!defined('IN_WACKO')) if (!defined('IN_WACKO'))
{ {
exit; exit;
} }
// {{hashid}} // {{hashid version=0|1}}
// set defaults
$version ??= 1;
// import the Hashids class into the global namespace // import the Hashids class into the global namespace
use Hashids\Hashids; use Hashids\Hashids;
if ($this->db->show_permalink == 1 || ($this->db->show_permalink == 2 && $this-> if ( $this->db->show_permalink == 1
get_user()) ) || ($this->db->show_permalink == 2 && $this->get_user()) )
{ {
$hashids = new Hashids($this->db->hashid_seed); $hashids = new Hashids($this->db->hashid_seed);
if (isset($this->page['version_id'])) if (!$version)
{
$version_id = 0;
}
else if (isset($this->page['version_id']))
{ {
$version_id = $this->page['version_id']; $version_id = $this->page['version_id'];
} }
else else
{ {
$old_version = $this->db->load_single( $old_version = $this->db->load_single(
"SELECT version_id " . "SELECT version_id " .
"FROM " . $this->prefix . "revision " . "FROM " . $this->prefix . "revision " .
"WHERE page_id = " . (int) $this->page['page_id'] . " " . "WHERE page_id = " . (int) $this->page['page_id'] . " " .
"ORDER BY version_id DESC " . "ORDER BY version_id DESC " .
skipping to change at line 39 skipping to change at line 47
$version_id = $old_version['version_id'] + 1; $version_id = $old_version['version_id'] + 1;
} }
$ids = [$this->page['page_id'], $version_id]; $ids = [$this->page['page_id'], $version_id];
sscanf(hash('sha1', $ids[0] . $this->db->hashid_seed . $ids[1]), '%7x', $ ids[2]); sscanf(hash('sha1', $ids[0] . $this->db->hashid_seed . $ids[1]), '%7x', $ ids[2]);
$id = $hashids->encode($ids); $id = $hashids->encode($ids);
// dbg('hashiding', $ids, '=>', $id); // dbg('hashiding', $ids, '=>', $id);
$tpl->url = $this->href('', $id, '', '', '', false); $tpl->title = $this->_t($version ? 'PermaLinkTip' : 'PermaLink0Tip');
$tpl->url = $this->href('', $id, '', '', '', false);
} }
 End of changes. 4 change blocks. 
5 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)