Exception

Error

We're sorry, but an unhandled error occurred. Please see the details below.

preg_replace(): Argument #3 ($subject) must be of type array|string, stdClass given

~/plugins/businessbecause/schools/controllers/http/controllers/Programs.php line 249

        return $result;
    }
 
 
    public function check_img_filename($data,$DIR){
        //dd($DIR);
        $data_image_webp = preg_replace('/\\.[^.\\s]{3,4}$/', '', $data);#get filename without extension
       # dd($data);
        //$image_extension = explode('.', $data);
       // $hub_page_image_image_extension = end($image_extension);
        // dd($hub_page_image_webp);
        $dirname =$_SERVER['DOCUMENT_ROOT'].$DIR;
        $org_filenames = glob("$dirname/*{".$data_image_webp.'.webp'."}*", GLOB_BRACE);

Stack trace

# Called Code Document Line
43 preg_replace() ~/plugins/businessbecause/schools/controllers/http/controllers/Programs.php 249
42 BusinessBecause\Schools\Controllers\Http\Controllers\Programs->check_img_filename() ~/plugins/businessbecause/news/controllers/http/controllers/News.php 1056
41 BusinessBecause\News\Controllers\Http\Controllers\News->view_article() ~/plugins/businessbecause/news/components/Article.php 143
40 Businessbecause\News\Components\Article->loadPost() ~/plugins/businessbecause/news/components/Article.php 38
39 Businessbecause\News\Components\Article->onRun() ~/modules/cms/classes/CmsCompoundObject.php 179
38 Cms\Classes\CmsCompoundObject->runComponents() ~/modules/cms/classes/Controller.php 501
37 Cms\Classes\Controller->execPageCycle() ~/modules/cms/classes/Controller.php 389
36 Cms\Classes\Controller->runPage() ~/modules/cms/classes/Controller.php 222
35 Cms\Classes\Controller->run() ~/modules/cms/classes/CmsController.php 50
34 Cms\Classes\CmsController->run() ~/vendor/laravel/framework/src/Illuminate/Routing/Controller.php 54
33 Illuminate\Routing\Controller->callAction() ~/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php 45
32 Illuminate\Routing\ControllerDispatcher->dispatch() ~/vendor/laravel/framework/src/Illuminate/Routing/Route.php 219
31 Illuminate\Routing\Route->runController() ~/vendor/laravel/framework/src/Illuminate/Routing/Route.php 176
30 Illuminate\Routing\Route->run() ~/vendor/laravel/framework/src/Illuminate/Routing/Router.php 681
29 Illuminate\Routing\Router->Illuminate\Routing\{closure}() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 130
28 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/plugins/rainlab/translate/classes/LocaleMiddleware.php 29
27 RainLab\Translate\Classes\LocaleMiddleware->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
26 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php 41
25 Illuminate\Routing\Middleware\SubstituteBindings->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
24 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php 49
23 Illuminate\View\Middleware\ShareErrorsFromSession->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
22 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php 56
21 Illuminate\Session\Middleware\StartSession->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
20 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php 37
19 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
18 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php 67
17 Illuminate\Cookie\Middleware\EncryptCookies->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
16 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 105
15 Illuminate\Pipeline\Pipeline->then() ~/vendor/laravel/framework/src/Illuminate/Routing/Router.php 683
14 Illuminate\Routing\Router->runRouteWithinStack() ~/vendor/laravel/framework/src/Illuminate/Routing/Router.php 658
13 Illuminate\Routing\Router->runRoute() ~/vendor/laravel/framework/src/Illuminate/Routing/Router.php 624
12 Illuminate\Routing\Router->dispatchToRoute() ~/vendor/october/rain/src/Router/CoreRouter.php 31
11 October\Rain\Router\CoreRouter->dispatch() ~/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php 170
10 Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 130
9 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php 63
8 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle() ~/vendor/october/rain/src/Foundation/Http/Middleware/CheckForMaintenanceMode.php 23
7 October\Rain\Foundation\Http\Middleware\CheckForMaintenanceMode->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
6 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/plugins/offline/clockwork/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkMiddleware.php 29
5 Clockwork\Support\Laravel\ClockworkMiddleware->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
4 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 105
3 Illuminate\Pipeline\Pipeline->then() ~/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php 145
2 Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() ~/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php 110
1 Illuminate\Foundation\Http\Kernel->handle() ~/index.php 43