Opened 10 years ago
Closed 10 years ago
#34708 closed defect (bug) (fixed)
Empty DB_CHARSET leads to error in strip_invalid_text
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.4 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Database | Keywords: | |
| Focuses: | Cc: |
Description
Found this while running unit tests without DB_CHARSET defined. wpdb::strip_invalid_text assumes $wpdb->charset is set and uses it in a query.
For the unit tests, this causes test_strip_invalid_text_from_query_cp1251_is_safe to fail:
WordPress database 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 ') AS x_0' at line 1 for query SELECT CONVERT( CONVERT( 'INSERT INTO test_cp1251_query_d9187( `a` ) VALUES( \'safe data\' )' USING cp1251 ) USING ) AS x_0 made by PHPUnit_TextUI_Command::main, PHPUnit_TextUI_Command->run, PHPUnit_TextUI_TestRunner->doRun, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestCase->run, PHPUnit_Framework_TestResult->run, PHPUnit_Framework_TestCase->runBare, PHPUnit_Framework_TestCase->runTest, ReflectionMethod->invokeArgs, Tests_DB_Charset->test_strip_invalid_text_from_query_cp1251_is_safe, wpdb_exposed_methods_for_testing->strip_invalid_text_from_query, wpdb_exposed_methods_for_testing->__call, call_user_func_array
Since at least [33310].
Change History (1)
Note: See
TracTickets for help on using
tickets.
In 35655: