friendica / friendica-directory

Global directory for the Friendica project. The repository has moved to git.friendi.ca/friendica/friendica-directory
GNU Affero General Public License v3.0
20 stars 11 forks source link

Slim Application Error when @ in search string #76

Closed AlfredSK closed 3 years ago

AlfredSK commented 3 years ago

The directory is throwing a 'Slim Application Error' when the search string contains an @.

Example 1: Go to the directory page. Open the search field. Search for support@libranet.de or some other webfinger address.

Example 2: Configure Friendica node to use the global directory for searching users. Search for support@libranet.de or some other webfinger address in Friendica itself.

MrPetovan commented 3 years ago

Thank you for the report!

AlfredSK commented 3 years ago

This is something an admin reported. I could reproduce the issue with the search on dir.friendica.social and dir.libranet.de.

I can provide the full error message If necessary as soon as I am home.

AlfredSK commented 3 years ago

Just for the record because you already fixed it. Thank you!

Slim Application Error:
Type: PDOException
Code: 42000
Message: SQLSTATE[42000]: Syntax error or access violation: 1064 syntax error, unexpected '@', expecting $end
File: .../vendor/atlas/pdo/src/Connection.php
Line: 138
Trace: #0 .../vendor/atlas/pdo/src/Connection.php(138): PDOStatement->execute()
#1 .../vendor/atlas/pdo/src/Connection.php(186): Atlas\Pdo\Connection->perform()
#2 .../src/classes/Views/Widget/AccountTypeTabs.php(44): Atlas\Pdo\Connection->fetchAll()
#3 .../src/classes/Controllers/Web/Search.php(82): Friendica\Directory\Views\Widget\AccountTypeTabs->render()
#4 .../src/classes/Routes/Web/BaseRoute.php(39): Friendica\Directory\Controllers\Web\Search->render()
#5 .../src/routes.php(22): Friendica\Directory\Routes\Web\BaseRoute->__invoke()
#6 [internal function]: Closure->{closure}()
#7 .../vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func()
#8 .../vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke()
#9 .../vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke()
#10 .../vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack()
#11 .../vendor/slim/slim/Slim/App.php(503): Slim\Route->run()
#12 .../vendor/gofabian/negotiation-middleware/src/NegotiationMiddleware.php(81): Slim\App->__invoke()
#13 [internal function]: Gofabian\Negotiation\NegotiationMiddleware->__invoke()
#14 .../vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()
#15 [internal function]: Slim\DeferredCallable->__invoke()
#16 .../vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()
#17 .../vendor/boronczyk/localization-middleware/src/LocalizationMiddleware.php(166): Slim\App->Slim\{closure}()
#18 [internal function]: Boronczyk\LocalizationMiddleware->__invoke()
#19 .../vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()
#20 [internal function]: Slim\DeferredCallable->__invoke()
#21 .../vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()
#22 .../src/classes/Middleware/ZrlMiddleware.php(38): Slim\App->Slim\{closure}()
#23 [internal function]: Friendica\Directory\Middleware\ZrlMiddleware->__invoke()
#24 .../vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()
#25 [internal function]: Slim\DeferredCallable->__invoke()
#26 .../vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()
#27 .../vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}()
#28 .../vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack()
#29 .../vendor/slim/slim/Slim/App.php(297): Slim\App->process()
#30 .../public/index.php(36): Slim\App->run()
#31 {main}
MrPetovan commented 3 years ago

I updated dir.friendica.social with the fix.