mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08:00
Apply StyleCi recommendation
This commit is contained in:
parent
c2a46b7af7
commit
34c64acb75
|
@ -85,9 +85,9 @@ class Request
|
||||||
|
|
||||||
foreach ($_GET as $key => $value) {
|
foreach ($_GET as $key => $value) {
|
||||||
// only return if value is empty and key matches RegEx
|
// only return if value is empty and key matches RegEx
|
||||||
if (($value === "") and preg_match($pasteIdRegEx, $key, $match)) {
|
if (($value === '') and preg_match($pasteIdRegEx, $key, $match)) {
|
||||||
return $match[0];
|
return $match[0];
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'invalid id';
|
return 'invalid id';
|
||||||
|
|
|
@ -680,7 +680,7 @@ class ControllerTest extends PHPUnit_Framework_TestCase
|
||||||
public function testReadInvalidId()
|
public function testReadInvalidId()
|
||||||
{
|
{
|
||||||
$_SERVER['QUERY_STRING'] = 'foo';
|
$_SERVER['QUERY_STRING'] = 'foo';
|
||||||
$_GET["foo"] = '';
|
$_GET['foo'] = '';
|
||||||
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
|
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
|
||||||
ob_start();
|
ob_start();
|
||||||
new Controller;
|
new Controller;
|
||||||
|
|
|
@ -135,7 +135,7 @@ class RequestTest extends PHPUnit_Framework_TestCase
|
||||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||||
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
|
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
|
||||||
$_SERVER['QUERY_STRING'] = $id;
|
$_SERVER['QUERY_STRING'] = $id;
|
||||||
$_GET = [$id => ''];
|
$_GET = array($id => '');
|
||||||
$_POST['deletetoken'] = 'bar';
|
$_POST['deletetoken'] = 'bar';
|
||||||
$request = new Request;
|
$request = new Request;
|
||||||
$this->assertTrue($request->isJsonApiCall(), 'is JSON Api call');
|
$this->assertTrue($request->isJsonApiCall(), 'is JSON Api call');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user