Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/import.lib.php')
-rw-r--r--libraries/import.lib.php55
1 files changed, 27 insertions, 28 deletions
diff --git a/libraries/import.lib.php b/libraries/import.lib.php
index a74b4a0b3c..bd3040312b 100644
--- a/libraries/import.lib.php
+++ b/libraries/import.lib.php
@@ -106,13 +106,13 @@ function PMA_importRunQuery($sql = '', $full = '', $controluser = false,
// USE query changes the database, son need to track
// while running multiple queries
$is_use_query
- = ($pmaString->stripos($import_run_buffer['sql'], "use ") !== false)
+ = (/*overload*/mb_stripos($import_run_buffer['sql'], "use ") !== false)
? true
: false;
$max_sql_len = max(
$max_sql_len,
- $pmaString->strlen($import_run_buffer['sql'])
+ /*overload*/mb_strlen($import_run_buffer['sql'])
);
if (! $sql_query_disabled) {
$sql_query .= $import_run_buffer['full'];
@@ -255,7 +255,7 @@ function PMA_importRunQuery($sql = '', $full = '', $controluser = false,
// the complete query in the textarea)
if (! $go_sql && $run_query) {
if (! empty($sql_query)) {
- if ($pmaString->strlen($sql_query) > 50000
+ if (/*overload*/mb_strlen($sql_query) > 50000
|| $executed_queries > 50
|| $max_sql_len > 1000
) {
@@ -360,14 +360,13 @@ function PMA_importGetNextChunk($size = 32768)
if ($GLOBALS['import_file'] == 'none') {
// Well this is not yet supported and tested,
// but should return content of textarea
- if ($pmaString->strlen($GLOBALS['import_text']) < $size) {
+ if (/*overload*/mb_strlen($GLOBALS['import_text']) < $size) {
$GLOBALS['finished'] = true;
return $GLOBALS['import_text'];
} else {
- $r = $pmaString->substr($GLOBALS['import_text'], 0, $size);
+ $r = /*overload*/mb_substr($GLOBALS['import_text'], 0, $size);
$GLOBALS['offset'] += $size;
- $GLOBALS['import_text'] = $pmaString
- ->substr($GLOBALS['import_text'], $size);
+ $GLOBALS['import_text'] = /*overload*/mb_substr($GLOBALS['import_text'], $size);
return $r;
}
}
@@ -382,8 +381,8 @@ function PMA_importGetNextChunk($size = 32768)
$GLOBALS['finished'] = feof($import_handle);
break;
case 'application/zip':
- $result = $pmaString->substr($GLOBALS['import_text'], 0, $size);
- $GLOBALS['import_text'] = $pmaString->substr($GLOBALS['import_text'], $size);
+ $result = /*overload*/mb_substr($GLOBALS['import_text'], 0, $size);
+ $GLOBALS['import_text'] = /*overload*/mb_substr($GLOBALS['import_text'], $size);
$GLOBALS['finished'] = empty($GLOBALS['import_text']);
break;
case 'none':
@@ -407,12 +406,12 @@ function PMA_importGetNextChunk($size = 32768)
if ($GLOBALS['offset'] == $size) {
// UTF-8
if (strncmp($result, "\xEF\xBB\xBF", 3) == 0) {
- $result = $pmaString->substr($result, 3);
+ $result = /*overload*/mb_substr($result, 3);
// UTF-16 BE, LE
} elseif (strncmp($result, "\xFE\xFF", 2) == 0
|| strncmp($result, "\xFF\xFE", 2) == 0
) {
- $result = $pmaString->substr($result, 2);
+ $result = /*overload*/mb_substr($result, 2);
}
}
return $result;
@@ -470,10 +469,10 @@ function PMA_getColumnAlphaName($num)
if ($num == 0) {
// use 'Z' if column number is 0,
// this is necessary because A-Z has no 'zero'
- $col_name .= $pmaString->chr(($A + 26) - 1);
+ $col_name .= /*overload*/mb_chr(($A + 26) - 1);
} else {
// convert column number to ASCII character
- $col_name .= $pmaString->chr(($A + $num) - 1);
+ $col_name .= /*overload*/mb_chr(($A + $num) - 1);
}
return $col_name;
@@ -501,8 +500,8 @@ function PMA_getColumnNumberFromName($name)
/** @var PMA_String $pmaString */
$pmaString = $GLOBALS['PMA_String'];
- $name = $pmaString->strtoupper($name);
- $num_chars = $pmaString->strlen($name);
+ $name = /*overload*/mb_strtoupper($name);
+ $num_chars = /*overload*/mb_strlen($name);
$column_number = 0;
for ($i = 0; $i < $num_chars; ++$i) {
// read string from back to front
@@ -512,7 +511,7 @@ function PMA_getColumnNumberFromName($name)
// and subtract 64 to get corresponding decimal value
// ASCII value of "A" is 65, "B" is 66, etc.
// Decimal equivalent of "A" is 1, "B" is 2, etc.
- $number = (int)($pmaString->ord($name[$char_pos]) - 64);
+ $number = (int)(/*overload*/mb_ord($name[$char_pos]) - 64);
// base26 to base10 conversion : multiply each number
// with corresponding value of the position, in this case
@@ -561,10 +560,10 @@ function PMA_getDecimalPrecision($last_cumulative_size)
{
/** @var PMA_String $pmaString */
$pmaString = $GLOBALS['PMA_String'];
- return (int)$pmaString->substr(
+ return (int)/*overload*/mb_substr(
$last_cumulative_size,
0,
- $pmaString->strpos($last_cumulative_size, ",")
+ /*overload*/mb_strpos($last_cumulative_size, ",")
);
}
@@ -581,11 +580,11 @@ function PMA_getDecimalScale($last_cumulative_size)
{
/** @var PMA_String $pmaString */
$pmaString = $GLOBALS['PMA_String'];
- return (int) $pmaString->substr(
+ return (int) /*overload*/mb_substr(
$last_cumulative_size,
- ($pmaString->strpos($last_cumulative_size, ",") + 1),
- ($pmaString->strlen($last_cumulative_size)
- - $pmaString->strpos($last_cumulative_size, ","))
+ (/*overload*/mb_strpos($last_cumulative_size, ",") + 1),
+ (/*overload*/mb_strlen($last_cumulative_size)
+ - /*overload*/mb_strpos($last_cumulative_size, ","))
);
}
@@ -602,8 +601,8 @@ function PMA_getDecimalSize($cell)
{
/** @var PMA_String $pmaString */
$pmaString = $GLOBALS['PMA_String'];
- $curr_size = $pmaString->strlen((string)$cell);
- $decPos = $pmaString->strpos($cell, ".");
+ $curr_size = /*overload*/mb_strlen((string)$cell);
+ $decPos = /*overload*/mb_strpos($cell, ".");
$decPrecision = ($curr_size - 1) - $decPos;
$m = $curr_size - 1;
@@ -632,7 +631,7 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type,
) {
/** @var PMA_String $pmaString */
$pmaString = $GLOBALS['PMA_String'];
- $curr_size = $pmaString->strlen((string)$cell);
+ $curr_size = /*overload*/mb_strlen((string)$cell);
/**
* If the cell is NULL, don't treat it as a varchar
@@ -770,7 +769,7 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type,
$oldM = PMA_getDecimalPrecision($last_cumulative_size);
$oldD = PMA_getDecimalScale($last_cumulative_size);
$oldInt = $oldM - $oldD;
- $newInt = $pmaString->strlen((string)$cell);
+ $newInt = /*overload*/mb_strlen((string)$cell);
/* See which has the larger integer length */
if ($oldInt >= $newInt) {
@@ -851,8 +850,8 @@ function PMA_detectType($last_cumulative_type, $cell)
}
if ($cell == (string)(float)$cell
- && $pmaString->strpos($cell, ".") !== false
- && $pmaString->substrCount($cell, ".") == 1
+ && /*overload*/mb_strpos($cell, ".") !== false
+ && /*overload*/mb_substr_count($cell, ".") == 1
) {
return DECIMAL;
}