mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-28 04:09:56 +03:00
fixes #1960 custom pwg_nl2br to avoid warning on PHP 8.1+
This commit is contained in:
parent
047a447585
commit
fc5bc47bc3
3 changed files with 16 additions and 11 deletions
|
@ -327,7 +327,7 @@ if (isset($conf['header_notes']))
|
||||||
add_event_handler('render_category_literal_description', 'render_category_literal_description');
|
add_event_handler('render_category_literal_description', 'render_category_literal_description');
|
||||||
if ( !$conf['allow_html_descriptions'] )
|
if ( !$conf['allow_html_descriptions'] )
|
||||||
{
|
{
|
||||||
add_event_handler('render_category_description', 'nl2br');
|
add_event_handler('render_category_description', 'pwg_nl2br');
|
||||||
}
|
}
|
||||||
add_event_handler('render_comment_content', 'render_comment_content');
|
add_event_handler('render_comment_content', 'render_comment_content');
|
||||||
add_event_handler('render_comment_author', 'strip_tags');
|
add_event_handler('render_comment_author', 'strip_tags');
|
||||||
|
|
|
@ -710,4 +710,19 @@ function flush_page_messages()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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)
|
||||||
|
{
|
||||||
|
if (empty($string))
|
||||||
|
{
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nl2br($string);
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
10
picture.php
10
picture.php
|
@ -124,16 +124,6 @@ add_event_handler('render_element_content', 'default_picture_content');
|
||||||
// add default event handler for rendering element description
|
// add default event handler for rendering element description
|
||||||
add_event_handler('render_element_description', 'pwg_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');
|
trigger_notify('loc_begin_picture');
|
||||||
|
|
||||||
// this is the default handler that generates the display for the element
|
// this is the default handler that generates the display for the element
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue