Skip to content

Commit

Permalink
Accept custom library if not an array
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Jan 28, 2015
1 parent d910b99 commit dc78c5f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/CensorWords.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ public function setDictionary($dictionary) {

}

// if just a single file was passed
} elseif (is_string($this->dictionary)) {
include('dict/'.$this->dictionary.'.php');
if (file_exists('dict/'.$this->dictionary.'.php')) {

} else {
// custom user library
include($this->dictionary);
}
}

$this->badwords = $badwords;
Expand Down

0 comments on commit dc78c5f

Please sign in to comment.