Version 4.7.23
This commit is contained in:
1 parent
7124a02564
commit
25ddeb65d6
1791 files changed
+76990
-44452
No files matched your search
@@ -459,7 +459,6 @@ class _Warning extends \IPS\Content\Item
|
||||
|
||||
if ( $this->cheev_point_reduction )
|
||||
{
|
||||
$member->achievements_points -= $this->cheev_point_reduction;
|
||||
|
||||
if ( $member->achievements_points >= $this->cheev_point_reduction )
|
||||
{
|
||||
@@ -470,6 +469,9 @@ class _Warning extends \IPS\Content\Item
|
||||
{
|
||||
/* Eg points to deduct is 50, user has 10, so set points deducted to 10 so undo doesn't add 50 back */
|
||||
$this->cheev_point_reduction = $member->achievements_points;
|
||||
$member->achievements_points -= $this->cheev_point_reduction;
|
||||
|
||||
$this->save();
|
||||
}
|
||||
|
||||
$consequences['cheev_point_reduction'] = $this->cheev_point_reduction;
|
||||
@@ -657,6 +659,20 @@ class _Warning extends \IPS\Content\Item
|
||||
if ( $values[ 'warn_' . $f ] instanceof \IPS\DateTime )
|
||||
{
|
||||
$difference = \IPS\DateTime::create()->setTimezone( $values[ 'warn_' . $f ]->getTimezone() )->diff( $values[ 'warn_' . $f ] );
|
||||
|
||||
/**
|
||||
* Due to a bug in PHP 8.0, DateTime::diff() can return -1 for the hour, and an extra day. We need to look for this specifically and set hour to 23, and reduce days by 1. This bug is fixed in 8.1, so this should be removed when that version is required.
|
||||
* @see <a href='https://bugs.php.net/bug.php?id=66545'>#66545</a>
|
||||
*/
|
||||
if ( version_compare( PHP_VERSION, '8.1.0', '<' ) )
|
||||
{
|
||||
if ( $difference->h === -1 )
|
||||
{
|
||||
$difference->h = 23;
|
||||
$difference->d = $difference->d - 1;
|
||||
}
|
||||
}
|
||||
|
||||
$period = 'P';
|
||||
foreach ( array( 'y' => 'Y', 'm' => 'M', 'd' => 'D' ) as $k => $v )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user