Laravel 10.x Shift #49
@@ -53,7 +53,10 @@ class OCRController extends ApiController
|
||||
curl_setopt($ch, CURLOPT_BUFFERSIZE, 128); // more progress info
|
||||
curl_setopt($ch, CURLOPT_NOPROGRESS, false);
|
||||
curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function (
|
||||
$downloadSize, $downloaded, $uploadSize, $uploaded
|
||||
$downloadSize,
|
||||
$downloaded,
|
||||
$uploadSize,
|
||||
$uploaded
|
||||
) use ($maxDownloadSize) {
|
||||
return ($downloaded > $maxDownloadSize) ? 1 : 0;
|
||||
});
|
||||
@@ -99,7 +102,6 @@ class OCRController extends ApiController
|
||||
$result = '';
|
||||
$img = imagecreatefromstring($curlResult);
|
||||
if ($img !== false && (($options !== null && imagefilter($img, $filter, $options) === true) || ($options === null && imagefilter($img, $filter) === true))) {
|
||||
|
||||
ob_start();
|
||||
imagepng($img);
|
||||
$imgData = ob_get_contents();
|
||||
@@ -192,7 +194,7 @@ class OCRController extends ApiController
|
||||
$command = escapeshellcmd($cmd);
|
||||
$output = shell_exec($cmd);
|
||||
if ($output !== null && strlen($output) > 0) {
|
||||
$output = substr($output, strpos($output, '----------START----------') + 25);
|
||||
$output = substr($output, (strpos($output, '----------START----------') + 25));
|
||||
} else {
|
||||
$output = '';
|
||||
}
|
||||
|
||||
@@ -35,7 +35,8 @@ class SubscriptionController extends ApiController
|
||||
return $this->respondAsResource(
|
||||
$collection,
|
||||
['isCollection' => true,
|
||||
'appendData' => ['total' => $total]]
|
||||
'appendData' => ['total' => $total]
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ class Permission extends Model
|
||||
'user',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Get the User associated with this model
|
||||
*
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
@@ -6,6 +7,7 @@ class ContactFormTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
|
||||
public function testContactForm()
|
||||
{
|
||||
$formData = [
|
||||
|
||||
Reference in New Issue
Block a user