diff --git a/app/Classes/Template.php b/app/Classes/Template.php index d01458e5..8798bb7f 100644 --- a/app/Classes/Template.php +++ b/app/Classes/Template.php @@ -38,7 +38,11 @@ class Template // @todo Make sure we have a structural objectclass, or make the template invalid $this->template = collect(json_decode($td->get($file),null,512,JSON_OBJECT_AS_ARRAY|JSON_THROW_ON_ERROR)); - } catch (\JsonException $e) { + // Also test the regex is valid. + if ($this->template->has('regexp')) + preg_match($this->regexp,''); + + } catch (\ErrorException|\JsonException $e) { $this->invalid = TRUE; $this->reason = $e->getMessage(); } diff --git a/app/Ldap/Entry.php b/app/Ldap/Entry.php index 084b4f1e..22ab025a 100644 --- a/app/Ldap/Entry.php +++ b/app/Ldap/Entry.php @@ -61,7 +61,7 @@ class Entry extends Model $to = new Template($file); if ($to->invalid) { - Log::debug(sprintf('Template [%s] is not valid (%s) - ignoring',$file,$to->reason)); + Log::alert(sprintf('Template [%s] is not valid (%s) - ignoring',$file,$to->reason)); } else { $templates->put($file,new Template($file));