aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2014-10-06 09:28:37 +0000
committerplegall <plg@piwigo.org>2014-10-06 09:28:37 +0000
commit83f267dc95eddb11e32e3e51984589615872c84a (patch)
tree1c07fb7a1b4731a0bafd9b449fb69233b7cfe4cc
parentacda99cf4d1d988e88e1d89151f059b23208a848 (diff)
merge r29901 from trunk to branch 2.7
bug 3156 fixed: avoid warning on PHP 5.2 for nl2br second parameter git-svn-id: http://piwigo.org/svn/branches/2.7@29902 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--picture.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/picture.php b/picture.php
index a0eadf3e8..94c2b3ea3 100644
--- a/picture.php
+++ b/picture.php
@@ -137,7 +137,17 @@ if ( isset($_GET['metadata']) )
// add default event handler for rendering element content
add_event_handler('render_element_content', 'default_picture_content');
// add default event handler for rendering element description
-add_event_handler('render_element_description', 'nl2br');
+add_event_handler('render_element_description', 'pwg_nl2br');
+
+/**
+ * pwg_nl2br is useful for PHP 5.2 which doesn't accept more than 1
+ * parameter on nl2br() (and anyway the second parameter of nl2br does not
+ * match what Piwigo gives.
+ */
+function pwg_nl2br($string)
+{
+ return nl2br($string);
+}
trigger_notify('loc_begin_picture');