Skip to content

Commit

Permalink
Fix deprecation notices for PHP 8.1+, and housekeeping.
Browse files Browse the repository at this point in the history
  • Loading branch information
croxton committed Sep 7, 2022
1 parent 0922b90 commit 5635e75
Show file tree
Hide file tree
Showing 4 changed files with 299 additions and 296 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Stash

![Release](https://img.shields.io/badge/release-3.1.0-brightgreen.svg)
![Release](https://img.shields.io/badge/release-3.1.1-brightgreen.svg)

Stash for ExpressionEngine 3.0 to 6.0+.

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "croxton/stash",
"description": "Extended templating for ExpressionEngine",
"version": "3.1.0",
"version": "3.1.1",
"homepage": "https://github.com/croxton/Stash",
"support": {
"docs": "https://github.com/croxton/Stash/blob/master/README.md",
Expand All @@ -15,6 +15,6 @@
}
],
"require": {
"php": ">=7.0.0"
"php": ">=7.4"
}
}
10 changes: 5 additions & 5 deletions system/user/addons/stash/mod.stash.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function init($calling_from_hook = FALSE)
}
else
{
$this->parse_vars = (bool) preg_match('/1|on|yes|y/i', $this->parse_vars);
$this->parse_vars = (bool) preg_match('/1|on|yes|y/i', (string) $this->parse_vars);
}

// parsing: how many passes of the template should we make? (more passes = more overhead). Default = 1
Expand Down Expand Up @@ -1952,13 +1952,13 @@ public function get_list($params=array(), $value='', $type='variable', $scope='u
// does limit contain a fraction?
if ($limit)
{
$limit = $this->_parse_fraction($limit, $offset, $absolute_results);
$limit = $this->_parse_fraction($limit, $absolute_results, $offset);
}

// does offset contain a fraction, e.g. '1/3' ?
if ($offset)
{
$offset = $this->_parse_fraction($offset, 0, $absolute_results);
$offset = $this->_parse_fraction($offset, $absolute_results);
}

// pagination
Expand Down Expand Up @@ -3956,7 +3956,7 @@ protected function sort_by_integer($a, $b)
* @param integer
* @return integer
*/
private function _parse_fraction($fraction, $offset=0, $total)
private function _parse_fraction($fraction, $total, $offset=0)
{
if (strstr($fraction, '/'))
{
Expand Down Expand Up @@ -4964,7 +4964,7 @@ private function _api_call($method, $params, $type='variable', $scope='user', $v
ee()->TMPL->tagdata = $value;
}

$this->init(); // re-initilize Stash
$this->init(); // re-initialize Stash
$result = $this->{$method}();

// restore original template params and tagdata
Expand Down
Loading

0 comments on commit 5635e75

Please sign in to comment.