diff --git a/.travis.yml b/.travis.yml index 7da6b2b6..8b6c8d20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,6 +47,7 @@ before_install: - psql -U travis -c 'create database travis_ci_test' - psql -U travis -d travis_ci_test -c 'create extension postgis' - travis_retry composer self-update --preview + - pear install pear/PHP_CodeSniffer && phpenv rehash install: - if [[ $setup = 'basic' ]]; then travis_retry composer install --no-interaction --prefer-dist; fi @@ -67,5 +68,6 @@ before_script: script: - php vendor/bin/phpunit --coverage-text + - phpcs #- php artisan dusk - php vendor/bin/security-checker security:check ./composer.lock --end-point=http://security.sensiolabs.org/check_lock diff --git a/app/Services/BookmarkService.php b/app/Services/BookmarkService.php index 18280df1..c8215f1a 100644 --- a/app/Services/BookmarkService.php +++ b/app/Services/BookmarkService.php @@ -31,8 +31,7 @@ class BookmarkService $content = $request->input('properties.content.0'); $categories = $request->input('properties.category'); } - if ( - ($request->header('Content-Type') == 'application/x-www-form-urlencoded') + if (($request->header('Content-Type') == 'application/x-www-form-urlencoded') || (str_contains($request->header('Content-Type'), 'multipart/form-data')) ) { diff --git a/app/Services/LikeService.php b/app/Services/LikeService.php index d4ff6f76..a51fc509 100644 --- a/app/Services/LikeService.php +++ b/app/Services/LikeService.php @@ -21,8 +21,7 @@ class LikeService //micropub request $url = normalize_url($request->input('properties.like-of.0')); } - if ( - ($request->header('Content-Type') == 'x-www-url-formencoded') + if (($request->header('Content-Type') == 'x-www-url-formencoded') || ($request->header('Content-Type') == 'multipart/form-data') ) { diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 00000000..141a41f6 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,8 @@ + + + Custom configuration for code running jonnybarnes.uk + ./app/ + + + +