[geeklog-hg] geeklog: Fixed a bug where migrate from backup failed (bug #0001...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Mon Jan 13 08:53:09 EST 2014


changeset 9425:0d6168099f85
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/0d6168099f85
user: Kenji ITO <mystralkk at gmail.com>
date: Mon Jan 13 22:52:16 2014 +0900
description:
Fixed a bug where migrate from backup failed (bug #0001733)

diffstat:

 public_html/admin/install/bigdump.php     |   2 +-
 public_html/admin/install/lib-install.php |  18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletions(-)

diffs (38 lines):

diff -r 00fcbbf47915 -r 0d6168099f85 public_html/admin/install/bigdump.php
--- a/public_html/admin/install/bigdump.php	Sun Jan 12 15:23:42 2014 -0500
+++ b/public_html/admin/install/bigdump.php	Mon Jan 13 22:52:16 2014 +0900
@@ -268,7 +268,7 @@
       // Execute query if end of query detected (; as last character) AND NOT in parents
       if (preg_match("/;$/",trim($dumpline)) && !$inparents) {
         if (!TESTMODE && !mysql_query(trim($query), $dbconnection)) {
-          echo INST_getAlertMsg($LANG_BIGDUMP[17] . $linenumber . ': ' . trim($dumpline) . '.<br ' . XHTML . '>' . $LANG_BIGDUMP[18] . trim(COM_nl2br(htmlentities($query))) . '<br ' . XHTML . '>' . $LANG_BIGDUMP[19] . mysql_error());
+          echo INST_getAlertMsg($LANG_BIGDUMP[17] . $linenumber . ': ' . trim($dumpline) . '.<br ' . XHTML . '>' . $LANG_BIGDUMP[18] . trim(INST_nl2br(htmlentities($query))) . '<br ' . XHTML . '>' . $LANG_BIGDUMP[19] . mysql_error());
           $error=true;
           break;
         }
diff -r 00fcbbf47915 -r 0d6168099f85 public_html/admin/install/lib-install.php
--- a/public_html/admin/install/lib-install.php	Sun Jan 12 15:23:42 2014 -0500
+++ b/public_html/admin/install/lib-install.php	Mon Jan 13 22:52:16 2014 +0900
@@ -1438,4 +1438,22 @@
     return $permError;
 }
 
+/**
+ * Replaces all newlines in a string with <br> or <br />,
+ * depending on the detected setting.  Ported from "lib-common.php"
+ * 
+ * @param    string    $string  The string to modify
+ * @return   string             The modified string
+ */
+function INST_nl2br($string)
+{
+    if (! defined('XHTML')) {
+        define('XHTML', '');
+    }
+
+    $replace = '<br' . XHTML . '>';
+    $find = array("\r\n", "\n\r", "\r", "\n");
+    return str_replace($find, $replace, $string);
+}
+
 ?>



More information about the geeklog-cvs mailing list