Skip to content

Commit 173d439

Browse files
committed
WPAjaxController fix
1 parent 46b8cd2 commit 173d439

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Services/NativeAjax/AbstractWPAjaxController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ public function __construct(?Request $request = null)
3030
}
3131

3232
$action = $this->request->query->get('action');
33-
if ($action) {
33+
$uri = $this->request->server->get('SCRIPT_NAME', '');
34+
35+
// Игонорировать /wp-admin/admin.php. Иначе вызывает ложные срабатывания
36+
// И ошибки.
37+
if ($action && strpos($uri, '/wp-admin/admin.php') === false) {
3438
$routeData = WpAjaxInitializer::route($action);
3539

3640
$this->request->attributes->set('methods', $routeData->getMethods());

0 commit comments

Comments
 (0)