Skip to content

Commit

Permalink
Use base64 if base64 is in the query parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
vstumpf committed Jul 3, 2024
1 parent 073124c commit 9db4167
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Flux/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1552,5 +1552,14 @@ public function parseBase62Until($str, $idx, $until = 0)
return array($ret, $idx);
}

/**
* Parse a Base64 string with url encoding
* Base64URL is the normal base64 with +/= replaced with -_.
* @access public
*/
public function base64Url_decode($str) {
return base64_decode(strtr($str, '-_.', '+/='));
}
}

?>
4 changes: 4 additions & 0 deletions modules/itemlink/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

$itemlink = $params->get('itemlink');

if ($params->get('base64')) {
$itemlink = $this->base64Url_decode($itemlink);
}

$itemlink_len = strlen($itemlink);

// get substring 5 characters
Expand Down
2 changes: 2 additions & 0 deletions themes/default/itemlink/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
<th> Item ID </th>
<td> <?php echo htmlspecialchars($nameid) ?> </td>
</tr>
<?php if ($isequip): ?>
<tr>
<th> Refine </th>
<td> +<?php echo htmlspecialchars($refine) ?> </td>
</tr>
<?php endif ?>
<?php if (Flux::config('ShowItemDesc')):?>
<tr>
<th> Description </th>
Expand Down

0 comments on commit 9db4167

Please sign in to comment.