Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: https://gumroad.com/l/hGYGh
26 changes: 13 additions & 13 deletions ajaximportfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,20 @@ function stripCommentLines($in) {

if (isset($file) && is_uploaded_file($file)) {
if (isset($format) && $format == "SQL") {
$lines = file($file);
$lines = file_get_contents($file);
$lines = str_replace( array("\r\n", "\n"), "\n", $lines ); // window/linux compat
$lines = str_replace( "\"\n", "\"\"\n", $lines ); // quickndirty way to make multiline explode on next line go fine
$statements = explode("\"\n",$lines );

// the file() function doesn't handle mac line endings correctly
if (sizeof($lines) == 1 && strpos($lines[0], "\r") > 0) {
$lines = explode("\r", $lines[0]);
}

$commentFree = array_map("stripCommentLines", $lines);

$contents = trim(implode('', $commentFree));

$statements = splitQueryText($contents);
} else {
$statements = file($file);
// coderofsalvation@ Tue Dec 24 11:42:20 CET 2013
// file() doesnt work with multiline csv columns
// actually, it should be questioned whether csv need
// to be parsed manually instead of fgetcsv in the firstplace :)
$csv = file_get_contents($file);
$csv = str_replace( array("\r\n", "\n"), "\n", $csv ); // window/linux compat
$csv = str_replace( "\"\n", "\"\"\n", $csv ); // quickndirty way to make multiline explode on next line go fine
$statements = explode("\"\n",$csv );

// see previous comment
if (sizeof($statements) == 1 && strpos($statements[0], "\r") > 0) {
Expand Down Expand Up @@ -167,4 +167,4 @@ function stripCommentLines($in) {

}

?>
?>
4 changes: 2 additions & 2 deletions ajaxsaveedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
if ($conn->getAdapter() == "mysql") {
if (isset($types) && substr($value, 0, 2) == "0x" && isset($binaryDTs) && in_array($types[$keyname], $binaryDTs)) {
$updates .= "`" . $keyname . "`=" . $value . ",";
} else if (!$value && $nulls[$keyname] == "YES") {
} else if (!$value && !($value != '' && (int)$value == 0) && $nulls[$keyname] == "YES") {
$updates .= "`" . $keyname . "`=NULL,";
} else {
$updates .= "`" . $keyname . "`='" . $value . "',";
Expand Down Expand Up @@ -127,4 +127,4 @@
}
}

?>
?>
4 changes: 2 additions & 2 deletions editcolumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
echo "<select name=\"CHARSET\" style=\"width: 125px\">";
echo "<option></option>";

if ($structureRow['Collation'] != "NULL") {
if ($structureRow['Collation'] != "NULL" && isset($structureRow['Collation'])) {
$currentCharset = $collationList[$structureRow['Collation']];
}

Expand Down Expand Up @@ -186,4 +186,4 @@

}

?>
?>