Porting MatrixHttpApi

This commit is contained in:
Yoann Celton 2018-11-30 10:23:48 +11:00 committed by Aryess
parent f0d4eedf71
commit fbf133db9d
3 changed files with 1195 additions and 7 deletions

View file

@ -18,7 +18,8 @@
"require": { "require": {
"php": "~7.2", "php": "~7.2",
"guzzlehttp/guzzle": "^6.3", "guzzlehttp/guzzle": "^6.3",
"rappasoft/laravel-helpers": "^1.0" "rappasoft/laravel-helpers": "^1.0",
"ext-json": "*"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit" : ">=5.4.3" "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 :"); 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://\'');
}
}
} }