Porting MatrixHttpApi

This commit is contained in:
Yoann Celton 2018-11-30 10:23:48 +11:00
parent b299540a2a
commit 3e75a76d24
3 changed files with 1195 additions and 7 deletions

View File

@ -18,7 +18,8 @@
"require": {
"php": "~7.2",
"guzzlehttp/guzzle": "^6.3",
"rappasoft/laravel-helpers": "^1.0"
"rappasoft/laravel-helpers": "^1.0",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit" : ">=5.4.3"

File diff suppressed because it is too large Load Diff

View File

@ -37,4 +37,10 @@ class Util {
throw new ValidationException("UserIDs must have a domain component, seperated by a :");
}
}
public static function checkMxcUrl(string $mxcUrl) {
if (substr($mxcUrl, 0, 6) != 'mxc://') {
throw new ValidationException('MXC URL did not begin with \'mxc://\'');
}
}
}