From 9853b7b662f9fd5912ebb2dbe2820a41be71d3de Mon Sep 17 00:00:00 2001 From: Jason Cleeland Date: Sun, 19 Sep 2004 02:53:53 +0000 Subject: [PATCH] Adds handling for tabs and newlines internal to responses (converts to {tab} {newline} on export, then converts back on import.) git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1198 b72ed6b6-b9f8-46b5-92b4-906544132732 --- admin/vvexport.php | 7 +++++-- admin/vvimport.php | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/admin/vvexport.php b/admin/vvexport.php index ec1f9080148..9bb6cc1391a 100644 --- a/admin/vvexport.php +++ b/admin/vvexport.php @@ -69,7 +69,7 @@ - ["._B_ADMIN_BT."] + ["._B_ADMIN_BT."] "; } elseif (isset($sid) && $sid) @@ -114,7 +114,10 @@ { foreach ($fieldnames as $field) { - echo $row[$field].$s; + $value=str_replace("\n", "{newline}", $row[$field]); + $value=str_replace("\r", "", $value); + $value=str_replace("\t", "{tab}", $value); + echo $value.$s; } echo "\n"; } diff --git a/admin/vvimport.php b/admin/vvimport.php index 26ef6337a34..e05b46dde34 100644 --- a/admin/vvimport.php +++ b/admin/vvimport.php @@ -103,7 +103,7 @@ $handle = fopen($the_full_file_path, "r"); while (!feof($handle)) { - $buffer = fgets($handle, 10240); //To allow for very long lines (up to 10k) + $buffer = fgets($handle, 20480); //To allow for very long lines (up to 10k) $bigarray[] = $buffer; } fclose($handle); @@ -150,7 +150,7 @@ if (trim($row) != "") { $fieldvalues=explode("\t", mysql_escape_string(str_replace("\n", "", $row)), $fieldcount+1); - if (isset($donotimport)) + if (isset($donotimport)) //remove any fields which no longer exist { foreach ($donotimport as $not) { @@ -174,7 +174,7 @@ echo ""._SUCCESS." File upload completed.

Note: Do NOT refresh this page

"; - echo "["._B_ADMIN_BT."]"; + echo "["._BROWSERESPONSES."]"; echo ""; } ?> \ No newline at end of file