1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Tagging causes server hiccups

Discussion in 'Resolved Bug Reports' started by AlexT, Jul 10, 2013.

  1. AlexT

    AlexT Well-Known Member

    See screenshot. Try to enter exactly the text as shown in the screenshot.
    Snap1.png

    It will cause this error in UserTagging:_getTagMatchUsers():

    Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM xf_user AS user WHERE () ORDER BY LENGTH(user.username) DESC' at line 3 -library/Zend/Db/Statement/Mysqli.php:77

    It seems that the regex in UserTagging:_getPossibleTagMatches() stumbles over this text with wrong matches, which then leads to the erroneous SQL query.
     
    Last edited: Jul 10, 2013
    erich37 likes this.
  2. Vincent

    Vincent Well-Known Member

    Here's the full error message:

    Code:
    Mysqli prepare error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM xf_user AS user WHERE () ORDER BY LENGTH(user.username) DESC' at line 3
    Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
    Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
    Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
    Zend_Db_Adapter_Abstract->query() in XenForo/Model/UserTagging.php at line 117
    XenForo_Model_UserTagging->_getTagMatchUsers() in XenForo/Model/UserTagging.php at line 16
    XenForo_Model_UserTagging->getTaggedUsersInMessage() in XenForo/DataWriter/DiscussionMessage/Post.php at line 70
    XenForo_DataWriter_DiscussionMessage_Post->_messagePreSave() in XenForo/DataWriter/DiscussionMessage.php at line 391
    XenForo_DataWriter_DiscussionMessage->_preSave() in XenForo/DataWriter.php at line 1434
    XenForo_DataWriter->preSave() in XenForo/ControllerPublic/Thread.php at line 541
    XenForo_ControllerPublic_Thread->actionAddReply() in XenForo/FrontController.php at line 337
    XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    XenForo_FrontController->run() in C:/Program Files (x86)/Ampps/www/XenForo/index.php at line 13
     
  3. Jeremy

    Jeremy XenForo Moderator Staff Member

    Looks like it just needs to verify it has a username before it attempts to tag someone. :)
     
  4. AlexT

    AlexT Well-Known Member

    More ways to trip the regex...

    Snap2.png
     
  5. Mike

    Mike XenForo Developer Staff Member

    Fixed now thanks.
     
    RoldanLT and AlexT like this.

Share This Page