Merge pull request #4053 from annando/useless_function_exists

Removed useless "function_exists" checks
This commit is contained in:
Hypolite Petovan 2017-12-12 03:47:54 -05:00 committed by GitHub
commit af6ca96e66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 107 deletions

View file

@ -376,7 +376,6 @@ function bb_tag_preg_replace($pattern, $replace, $name, $s) {
return $string;
}
if (! function_exists('bb_extract_images')) {
function bb_extract_images($body) {
$saved_image = array();
@ -418,9 +417,8 @@ function bb_extract_images($body) {
$new_body = $new_body . $orig_body;
return array('body' => $new_body, 'images' => $saved_image);
}}
}
if (! function_exists('bb_replace_images')) {
function bb_replace_images($body, $images) {
$newbody = $body;
@ -435,7 +433,7 @@ function bb_replace_images($body, $images) {
}
return $newbody;
}}
}
function bb_ShareAttributes($share, $simplehtml) {
$attributes = $share[2];

View file

@ -15,12 +15,6 @@ use Friendica\Object\Post;
require_once "include/bbcode.php";
require_once "include/acl_selectors.php";
/*
* Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
* is identical to the code in mod/message.php for 'item_extract_images' and
* 'item_redir_and_replace_images'
*/
if (! function_exists('item_extract_images')) {
function item_extract_images($body) {
$saved_image = array();
@ -62,9 +56,8 @@ function item_extract_images($body) {
$new_body = $new_body . $orig_body;
return array('body' => $new_body, 'images' => $saved_image);
}}
}
if (! function_exists('item_redir_and_replace_images')) {
function item_redir_and_replace_images($body, $images, $cid) {
$origbody = $body;
@ -104,7 +97,7 @@ function item_redir_and_replace_images($body, $images, $cid) {
$cnt++;
}
return $newbody;
}}
}
/**
* Render actions localized
@ -486,7 +479,6 @@ function item_condition() {
return "`item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`";
}
if (!function_exists('conversation')) {
/**
* "Render" a conversation or list of items for HTML display.
* There are two major forms of display:
@ -906,7 +898,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
));
return $o;
}}
}
function best_link_url($item, &$sparkle, $url = '') {
@ -1036,7 +1028,6 @@ function item_photo_menu($item) {
return $o;
}
if (! function_exists('builtin_activity_puller')) {
/**
* @brief Checks item to see if it is one of the builtin activities (like/dislike, event attendance, consensus items, etc.)
* Increments the count of each matching activity and adds a link to the author as needed.
@ -1112,9 +1103,8 @@ function builtin_activity_puller($item, &$conv_responses) {
return;
}
}
}}
}
if (! function_exists('format_like')) {
/**
* Format the vote text for a profile item
* @param int $cnt = number of people who vote the item
@ -1205,7 +1195,7 @@ function format_like($cnt, array $arr, $type, $id) {
$o .= $expanded;
return $o;
}}
}
function status_editor(App $a, $x, $notes_cid = 0, $popup = false) {
$o = '';

View file

@ -42,7 +42,6 @@ function construct_verb($item) {
* The purpose of this function is to apply system message length limits to
* imported messages without including any embedded photos in the length
*/
if (! function_exists('limit_body_size')) {
function limit_body_size($body) {
// logger('limit_body_size: start', LOGGER_DEBUG);
@ -125,7 +124,7 @@ function limit_body_size($body) {
} else {
return $body;
}
}}
}
function title_is_body($title, $body) {

View file

@ -14,7 +14,6 @@ use Friendica\Core\Config;
require_once "include/dba.php";
if (! function_exists('get_browser_language')) {
/**
* @brief get the prefered language from the HTTP_ACCEPT_LANGUAGE header
*/
@ -55,7 +54,7 @@ function get_browser_language() {
// in case none matches, get the system wide configured language, or fall back to English
return Config::get('system', 'language', 'en');
}}
}
function push_lang($language) {
@ -93,7 +92,6 @@ function pop_lang() {
// l
if (! function_exists('load_translation_table')) {
/**
* load string translation table for alternate language
*
@ -118,7 +116,7 @@ function load_translation_table($lang) {
include("view/lang/$lang/strings.php");
}
}}
}
/**
* @brief Return the localized version of the provided string with optional string interpolation