Skip to content

Commit

Permalink
fix fatal handler
Browse files Browse the repository at this point in the history
  • Loading branch information
rahmanramsi committed May 2, 2024
1 parent 10dac9c commit 04eca8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 2.0.8.2 : 02 May 2024
- Fix error handler when there's no error triggered

### 2.0.8.1 : 08 Februari 2024
- Fix error handler when there's no file on error log

Expand Down
6 changes: 4 additions & 2 deletions OjtPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,16 @@ public function getHttpClient($headers = [])
function fatalHandler()
{
$error = error_get_last();

// Sometimes fatalHandler called without error
if(!is_array($error)) return;

// Fatal error, E_ERROR === 1
if (array_key_exists('type', $error) && !in_array($error['type'], [E_COMPILE_ERROR, E_ERROR])) return;

// Sometime there's no file in error so we need to check it first
if (!array_key_exists('file', $error)) return;



if (!$this->str_contains($error['file'], 'ojtPlugin')) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<version>
<application>ojtPlugin</application>
<type>plugins.generic</type>
<release>2.0.8.1</release>
<date>2024-03-29</date>
<release>2.0.8.2</release>
<date>2024-05-02</date>
<lazy-load>0</lazy-load>
<class>OjtPlugin</class>
</version>

0 comments on commit 04eca8e

Please sign in to comment.