Page MenuHomePhabricator

D10798.diff
No OneTemporary

D10798.diff

diff --git a/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php b/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
--- a/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
+++ b/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
@@ -324,32 +324,15 @@
* can lead to data loss and security problems.
*/
protected function validateUTF8String($string) {
- // TODO: Make this `true` eventually, once we make storage adjustment
- // mandatory. For now, you can set it to `true` to test things.
- $has_utf8mb4 = false;
-
- if ($has_utf8mb4) {
- if (phutil_is_utf8($string)) {
- return;
- }
-
- throw new AphrontCharacterSetQueryException(
- pht(
- 'Attempting to construct a query using a non-utf8 string when '.
- 'utf8 is expected. Use the `%%B` conversion to escape binary '.
- 'strings data.'));
- } else {
- if (phutil_is_utf8_with_only_bmp_characters($string)) {
- return;
- }
-
- throw new AphrontCharacterSetQueryException(
- pht(
- 'Attempting to construct a query containing characters outside of '.
- 'the Unicode Basic Multilingual Plane. MySQL will silently truncate '.
- 'this data if it is inserted into a `utf8` column. Use the `%%B` '.
- 'conversion to escape binary strings data.'));
+ if (phutil_is_utf8($string)) {
+ return;
}
+
+ throw new AphrontCharacterSetQueryException(
+ pht(
+ 'Attempting to construct a query using a non-utf8 string when '.
+ 'utf8 is expected. Use the `%%B` conversion to escape binary '.
+ 'strings data.'));
}
}

File Metadata

Mime Type
text/plain
Expires
Thu, May 9, 5:47 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6268444
Default Alt Text
D10798.diff (1 KB)

Event Timeline