Skip to content

Commit

Permalink
Check variable type in import()
Browse files Browse the repository at this point in the history
  • Loading branch information
xenocrat committed Aug 27, 2023
1 parent c31d084 commit 4bc1e2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sfnt2woff.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class sfnt2woff {
const SFNT2WOFF_VERSION_MAJOR = 3;
const SFNT2WOFF_VERSION_MINOR = 2;
const SFNT2WOFF_VERSION_MINOR = 3;

const SIZEOF_SFNT_OFFSET = 12;
const SIZEOF_SFNT_ENTRY = 16;
Expand Down Expand Up @@ -35,6 +35,9 @@ class sfnt2woff {
private $woff_privlength = 0;

public function import($sfnt): void {
if (!is_string($sfnt))
throw new \Exception("File must be supplied as a string.");

$sfnt_length = strlen($sfnt);
$sfnt_tables = array();
$woff_tables = array();
Expand Down

0 comments on commit 4bc1e2a

Please sign in to comment.