scholarslab/NeatlineMaps — Issue #35: Search Bug
Author: waynegraham
Created: 2012-02-28 15:35:41+00:00
State: open

In Omeka 1.5, when I do a search for an item to associate a new map to that contains an apostrophe (e.g. Frenchman's Map), Omeka throws an exception. I think this should be a matter of wrapping the query string in mysql_escape_string to resolve the issue.

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 's%') LIMIT 10' at line 1

Stacktrace:
#0 /Applications/MAMP/htdocs_default/omeka-1.5/application/libraries/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('SELECT `item`.*...')
#1 /Applications/MAMP/htdocs_default/omeka-1.5/application/libraries/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'SELECT `item`.*...')
#2 /Applications/MAMP/htdocs_default/omeka-1.5/application/libraries/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('SELECT `item`.*...')
#3 [internal function]: Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Select), Array)
#4 /Applications/MAMP/htdocs_default/omeka-1.5/application/libraries/Omeka/Db.php(83): call_user_func_array(Array, Array)
#5 /Applications/MAMP/htdocs_default/omeka-1.5/application/libraries/Omeka/Db/Table.php(478): Omeka_Db->__call('query', Array)
#6 /Applications/MAMP/htdocs_default/omeka-1.5/application/libraries/Omeka/Db/Table.php(478): Omeka_Db->query(Object(Zend_Db_Select), Array)
#7 /Users/wsg4w/projects/NeatlineProjects/NeatlineMaps/helpers/NeatlineMapsFunctions.php(289): Omeka_Db_Table->fetchObjects(Object(Zend_Db_Select))
#8 /Users/wsg4w/projects/NeatlineProjects/NeatlineMaps/controllers/MapsController.php(142): _getItems('1', '', 'frenchman's')
#9 /Applications/MAMP/htdocs_default/omeka-1.5/application/libraries/Zend/Controller/Action.php(516): NeatlineMaps_MapsController->itemselectAction()
#10 /Applications/MAMP/htdocs_default/omeka-1.5/application/libraries/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('itemselectActio...')
#11 /Applications/MAMP/htdocs_default/omeka-1.5/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#12 /Applications/MAMP/htdocs_default/omeka-1.5/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#13 /Applications/MAMP/htdocs_default/omeka-1.5/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#14 /Applications/MAMP/htdocs_default/omeka-1.5/application/libraries/Omeka/Core.php(165): Zend_Application->run()
#15 /Applications/MAMP/htdocs_default/omeka-1.5/admin/index.php(44): Omeka_Core->run()
#16 {main}