Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
d96be836
Commit
d96be836
authored
19 years ago
by
Steven Wittens
Browse files
Options
Downloads
Patches
Plain Diff
-
#40515
: MySQL
UTF-8
conversion fixes
parent
dcb092e6
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
database/updates.inc
+4
-3
4 additions, 3 deletions
database/updates.inc
includes/database.mysql.inc
+0
-6
0 additions, 6 deletions
includes/database.mysql.inc
includes/database.mysqli.inc
+0
-6
0 additions, 6 deletions
includes/database.mysqli.inc
with
4 additions
and
15 deletions
database/updates.inc
+
4
−
3
View file @
d96be836
...
@@ -1491,10 +1491,11 @@ function _system_update_utf8($tables) {
...
@@ -1491,10 +1491,11 @@ function _system_update_utf8($tables) {
}
}
// See if database uses UTF-8 already
// See if database uses UTF-8 already
$url
=
parse_url
(
$GLOBALS
[
'db_url'
]);
global
$db_url
;
$url
=
parse_url
(
is_array
(
$db_url
)
?
$db_url
[
'default'
]
:
$db_url
);
$db_name
=
substr
(
$url
[
'path'
],
1
);
$db_name
=
substr
(
$url
[
'path'
],
1
);
list
(,
$create
)
=
db_fetch_array
(
db_query
(
'SHOW CREATE DATABASE `%s`'
,
$db_name
));
$result
=
db_fetch_array
(
db_query
(
'SHOW CREATE DATABASE `%s`'
,
$db_name
));
if
(
preg_match
(
'/utf8/i'
,
$create
))
{
if
(
preg_match
(
'/utf8/i'
,
array_pop
(
$result
)
))
{
return
array
();
return
array
();
}
}
...
...
This diff is collapsed.
Click to expand it.
includes/database.mysql.inc
+
0
−
6
View file @
d96be836
...
@@ -83,12 +83,6 @@ function db_connect($url) {
...
@@ -83,12 +83,6 @@ function db_connect($url) {
/* On MySQL 4.1 and later, force UTF-8 */
/* On MySQL 4.1 and later, force UTF-8 */
if
(
version_compare
(
mysql_get_server_info
(),
'4.1.0'
,
'>='
))
{
if
(
version_compare
(
mysql_get_server_info
(),
'4.1.0'
,
'>='
))
{
mysql_query
(
'SET NAMES "utf8"'
,
$connection
);
mysql_query
(
'SET NAMES "utf8"'
,
$connection
);
mysql_query
(
'SET collation_connection="utf8_general_ci"'
,
$connection
);
mysql_query
(
'SET collation_server="utf8_general_ci"'
,
$connection
);
mysql_query
(
'SET character_set_client="utf8"'
,
$connection
);
mysql_query
(
'SET character_set_connection="utf8"'
,
$connection
);
mysql_query
(
'SET character_set_results="utf8"'
,
$connection
);
mysql_query
(
'SET character_set_server="utf8"'
,
$connection
);
}
}
return
$connection
;
return
$connection
;
}
}
...
...
This diff is collapsed.
Click to expand it.
includes/database.mysqli.inc
+
0
−
6
View file @
d96be836
...
@@ -79,12 +79,6 @@ function db_connect($url) {
...
@@ -79,12 +79,6 @@ function db_connect($url) {
/* Force UTF-8 */
/* Force UTF-8 */
mysqli_query
(
$connection
,
'SET NAMES "utf8"'
);
mysqli_query
(
$connection
,
'SET NAMES "utf8"'
);
mysqli_query
(
$connection
,
'SET collation_connection="utf8_general_ci"'
);
mysqli_query
(
$connection
,
'SET collation_server="utf8_general_ci"'
);
mysqli_query
(
$connection
,
'SET character_set_client="utf8"'
);
mysqli_query
(
$connection
,
'SET character_set_connection="utf8"'
);
mysqli_query
(
$connection
,
'SET character_set_results="utf8"'
);
mysqli_query
(
$connection
,
'SET character_set_server="utf8"'
);
/**
/**
* from: http://bugs.php.net/bug.php?id=33772
* from: http://bugs.php.net/bug.php?id=33772
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment