View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update | 
|---|---|---|---|---|---|
| 0000425 | WackoWiki | administration | public | 2012-09-04 09:10 | 2014-03-21 11:51 | 
| Reporter | varaha | Assigned To | administrator | ||
| Priority | normal | Severity | major | Reproducibility | always | 
| Status | resolved | Resolution | fixed | ||
| Platform | Cloud x64 | OS | Fedora | OS Version | 17 | 
| Product Version | 5.1.0 | ||||
| Target Version | 5.4.0 | Fixed in Version | 5.4.0 | ||
| Summary | 0000425: admin panel database restore problem with PDO | ||||
| Description | If you use PDO driver and try restore any backup from admin panel, then content like this: %%(anyformatter) echo "Hellow\nAlfa\nDelta\nGamma"; %% appears like this %%(anyformatter) echo "Hellow Alfa Delta Gamma"; %% Due to code in admin/common/database.php : $row = str_replace('\\\\', "\\", $row); $row = str_replace('\\n', "\n", $row); $row = str_replace('\\t', "\t", $row); This code from \n makes NL and from \\n it makes no \n , but also NL Solved by patch (file in attach) like this: - $row = str_replace('\\\\', "\\", $row); - $row = str_replace('\\n', "\n", $row); - $row = str_replace('\\t', "\t", $row); + foreach($row as &$rstr) + $rstr = strtr($rstr, array( + "\\\\" => "\\", + '\\n' => "\n", + '\\t' => "\t" + )); | ||||
| Tags | No tags attached. | ||||
| Attached Files |  database.php.patch (611 bytes)   
 --- database.php.orig	2012-09-04 07:58:55.062099935 +0000
+++ database.php	2012-09-04 08:00:56.003099418 +0000
@@ -569,13 +569,16 @@
 			// wipe current data row to stay in low memory boundaries
 			$data[$i++] = '';
 
 			$row = explode("\t", $row);
 			// unescape divider chars
-			$row = str_replace('\\\\', "\\", $row);
-			$row = str_replace('\\n',  "\n", $row);
-			$row = str_replace('\\t',  "\t", $row);
+			foreach($row as &$rstr)
+				$rstr = strtr($rstr, array(
+					"\\\\" => "\\",
+					'\\n' => "\n",
+					'\\t' => "\t"
+					));
 
 			// prepare data
 			$j = 0;
 
 			foreach ($row as $cell)
 | ||||
| related to | 0000426 | resolved | administrator | small patch of write/read database tables structure | 
| Date Modified | Username | Field | Change | 
|---|---|---|---|
| 2012-09-04 09:10 | varaha | New Issue | |
| 2012-09-04 09:10 | varaha | File Added: database.php.patch | |
| 2012-09-08 05:23 | administrator | Assigned To | => administrator | 
| 2012-09-08 05:23 | administrator | Status | new => assigned | 
| 2012-09-08 05:23 | administrator | Target Version | => 5.1.x | 
| 2012-09-08 05:43 | administrator | Note Added: 0000860 | |
| 2012-09-08 05:43 | administrator | Status | assigned => resolved | 
| 2012-09-08 05:43 | administrator | Resolution | open => fixed | 
| 2012-09-08 05:43 | administrator | Fixed in Version | => 5.1.x | 
| 2012-09-08 06:55 | administrator | Relationship added | related to 0000426 | 
| 2014-03-21 11:51 | administrator | Fixed in Version | 5.1.x => 5.4.0 | 
| 2014-03-21 11:51 | administrator | Target Version | 5.1.x => 5.4.0 | 
