diff options
Diffstat (limited to '')
-rw-r--r-- | include/common.inc.php | 3 | ||||
-rw-r--r-- | include/functions_html.inc.php | 34 | ||||
-rw-r--r-- | include/functions_url.inc.php | 2 |
3 files changed, 8 insertions, 31 deletions
diff --git a/include/common.inc.php b/include/common.inc.php index 061c7246a..c898ec546 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -233,8 +233,7 @@ if ( !$conf['allow_html_descriptions'] ) { add_event_handler('render_category_description', 'nl2br'); } -add_event_handler('render_comment_content', 'htmlspecialchars'); -add_event_handler('render_comment_content', 'parse_comment_content'); +add_event_handler('render_comment_content', 'render_comment_content'); add_event_handler('render_comment_author', 'strip_tags'); add_event_handler('blockmanager_register_blocks', 'register_default_menubar_blocks', EVENT_HANDLER_PRIORITY_NEUTRAL-1); trigger_action('init'); diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index ecede503a..72a80c049 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -43,7 +43,7 @@ function get_cat_display_name($cat_informations, //$output = '<a href="'.get_absolute_root_url().$conf['home_page'].'">'.l10n('Home').'</a>'; $output = ''; $is_first=true; - + foreach ($cat_informations as $cat) { is_array($cat) or trigger_error( @@ -185,8 +185,9 @@ SELECT id, name, permalink * @param string content * @return string */ -function parse_comment_content($content) +function render_comment_content($content) { + $content = htmlspecialchars($content); $pattern = '/(https?:\/\/\S*)/'; $replacement = '<a href="$1" rel="nofollow">$1</a>'; $content = preg_replace($pattern, $replacement, $content); @@ -367,7 +368,7 @@ function fatal_error($msg, $title=null, $show_trace=true) { $title = 'Piwigo encountered a non recoverable error'; } - + $btrace_msg = ''; if ($show_trace and function_exists('debug_backtrace')) { @@ -440,7 +441,7 @@ function get_tags_content_title() ) ); } - + $title.= '<a href="'.$remove_url.'" style="border:none;" title="' .l10n('remove this tag from the list') @@ -478,14 +479,7 @@ function set_status_header($code, $text='') if ( ('HTTP/1.1' != $protocol) && ('HTTP/1.0' != $protocol) ) $protocol = 'HTTP/1.0'; - if ( version_compare( phpversion(), '4.3.0', '>=' ) ) - { - header( "$protocol $code $text", true, $code ); - } - else - { - header( "$protocol $code $text" ); - } + header( "$protocol $code $text", true, $code ); trigger_action('set_status_header', $code, $text); } @@ -497,22 +491,6 @@ function render_category_literal_description($desc) return strip_tags($desc, '<span><p><a><br><b><i><small><big><strong><em>'); } -/** returns the argument_ids array with new sequenced keys based on related - * names. Sequence is not case sensitive. - * Warning: By definition, this function breaks original keys - */ -function order_by_name($element_ids,$name) -{ - $ordered_element_ids = array(); - foreach ($element_ids as $k_id => $element_id) - { - $key = strtolower($name[$element_id]) .'-'. $name[$element_id] .'-'. $k_id; - $ordered_element_ids[$key] = $element_id; - } - ksort($ordered_element_ids); - return $ordered_element_ids; -} - /*event handler for menu*/ function register_default_menubar_blocks( $menu_ref_arr ) { diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php index d7d6dfcf3..db5fe3cb4 100644 --- a/include/functions_url.inc.php +++ b/include/functions_url.inc.php @@ -735,7 +735,7 @@ function get_gallery_home_url() global $conf; if (!empty($conf['gallery_url'])) { - if (url_is_remote($conf['gallery_url']) or strncmp($conf['gallery_url'], '/', 1)==0) + if (url_is_remote($conf['gallery_url']) or $conf['gallery_url'][0]=='/' ) { return $conf['gallery_url']; } |