mirror of
https://github.com/standardebooks/web.git
synced 2025-07-06 06:40:33 -04:00
Fix some validation errors
This commit is contained in:
parent
fcde084b2c
commit
b919a7e829
2 changed files with 11 additions and 5 deletions
|
@ -22,7 +22,7 @@ class HttpInput{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function RequestType(): int{
|
public static function RequestType(): int{
|
||||||
return preg_match('/\btext\/html\b/ius', $_SERVER['HTTP_ACCEPT']) ? WEB : REST;
|
return preg_match('/\btext\/html\b/ius', $_SERVER['HTTP_ACCEPT'] ?? '') ? WEB : REST;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function Str(string $type, string $variable, bool $allowEmptyString = true, string $default = null): ?string{
|
public static function Str(string $type, string $variable, bool $allowEmptyString = true, string $default = null): ?string{
|
||||||
|
|
|
@ -46,10 +46,16 @@ class PollVote extends PropertiesBase{
|
||||||
if($this->PollItem === null){
|
if($this->PollItem === null){
|
||||||
$error->Add(new Exceptions\InvalidPollException());
|
$error->Add(new Exceptions\InvalidPollException());
|
||||||
}
|
}
|
||||||
}
|
else{
|
||||||
|
if($this->PollItem->Poll === null){
|
||||||
if(!$this->PollItem->Poll->IsActive()){
|
$error->Add(new Exceptions\InvalidPollException());
|
||||||
$error->Add(new Exceptions\PollClosedException());
|
}
|
||||||
|
else{
|
||||||
|
if(!$this->PollItem->Poll->IsActive()){
|
||||||
|
$error->Add(new Exceptions\PollClosedException());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$error->HasExceptions){
|
if(!$error->HasExceptions){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue