From: Hypolite Petovan Date: Fri, 27 Jan 2017 03:57:53 +0000 (-0500) Subject: - Remove $theme_richtext_editor boot var X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=66482c1d9c35942f6b09a076d19f335d4afbfa0d;p=friendica.git - Remove $theme_richtext_editor boot var - Remove "richtext" feature - Remove fix_mce_lf() function - Remove nomce parameter --- diff --git a/boot.php b/boot.php index cd6db384a2..ed880ec09c 100644 --- a/boot.php +++ b/boot.php @@ -530,7 +530,6 @@ class App { public $videoheight = 350; public $force_max_items = 0; public $theme_thread_allow = true; - public $theme_richtext_editor = true; public $theme_events_in_profile = true; /** diff --git a/include/features.php b/include/features.php index 64ab932d00..74c110427c 100644 --- a/include/features.php +++ b/include/features.php @@ -11,11 +11,6 @@ * @return boolean */ function feature_enabled($uid, $feature) { - - if (($feature == 'richtext') AND !get_app()->theme_richtext_editor) { - return false; - } - $x = get_config('feature_lock', $feature); if ($x === false) { @@ -35,7 +30,7 @@ function feature_enabled($uid, $feature) { /** * @brief check if feature is enabled or disabled by default - * + * * @param string $feature * @return boolean */ @@ -52,13 +47,13 @@ function get_feature_default($feature) { /** * @brief Get a list of all available features - * + * * The array includes the setting group, the setting name, * explainations for the setting and if it's enabled or disabled * by default - * + * * @param bool $filtered True removes any locked features - * + * * @return array */ function get_features($filtered = true) { @@ -77,7 +72,6 @@ function get_features($filtered = true) { // Post composition 'composition' => array( t('Post Composition Features'), - array('richtext', t('Richtext Editor'), t('Enable richtext editor'), false, get_config('feature_lock','richtext')), array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'), false, get_config('feature_lock','preview')), array('aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, get_config('feature_lock','aclautomention')), ), @@ -142,11 +136,6 @@ function get_features($filtered = true) { } } - // Remove the richtext editor setting if the theme doesn't support it - if (!get_app()->theme_richtext_editor) { - unset($arr['composition'][1]); - } - call_hooks('get_features',$arr); return $arr; } diff --git a/include/text.php b/include/text.php index 77a9f25af9..f77a4dec2c 100644 --- a/include/text.php +++ b/include/text.php @@ -2045,13 +2045,6 @@ function undo_post_tagging($s) { return $s; } -function fix_mce_lf($s) { - $s = str_replace("\r\n","\n",$s); -// $s = str_replace("\n\n","\n",$s); - return $s; -} - - function protect_sprintf($s) { return(str_replace('%','%%',$s)); } @@ -2073,17 +2066,19 @@ function is_a_date_arg($s) { /** * remove intentation from a text */ -function deindent($text, $chr="[\t ]", $count=NULL) { - $text = fix_mce_lf($text); +function deindent($text, $chr = "[\t ]", $count = NULL) { $lines = explode("\n", $text); if (is_null($count)) { $m = array(); - $k=0; while($k 5 || $priority < 0) $priority = 0; - $info = fix_mce_lf(escape_tags(trim($_POST['info']))); + $info = escape_tags(trim($_POST['info'])); $r = q("UPDATE `contact` SET `profile-id` = %d, `priority` = %d , `info` = '%s', `hidden` = %d, `notify_new_posts` = %d, `fetch_further_information` = %d, diff --git a/mod/item.php b/mod/item.php index c9306c523a..6da9ce88e8 100644 --- a/mod/item.php +++ b/mod/item.php @@ -353,20 +353,6 @@ function item_post(App $a) { $categories .= file_tag_list_to_file($filedas, 'file'); } - // Work around doubled linefeeds in Tinymce 3.5b2 - // First figure out if it's a status post that would've been - // created using tinymce. Otherwise leave it alone. - -/* $plaintext = (local_user() ? intval(get_pconfig(local_user(),'system','plaintext')) || !feature_enabled($profile_uid,'richtext') : 0); - if((! $parent) && (! $api_source) && (! $plaintext)) { - $body = fix_mce_lf($body); - }*/ - $plaintext = (local_user() ? !feature_enabled($profile_uid,'richtext') : 0); - if((! $parent) && (! $api_source) && (! $plaintext)) { - $body = fix_mce_lf($body); - } - - // get contact info for poster $author = null; diff --git a/mod/message.php b/mod/message.php index 1a808701e3..9e96691466 100644 --- a/mod/message.php +++ b/mod/message.php @@ -52,17 +52,6 @@ function message_post(App $a) { $body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : ''); $recipient = ((x($_REQUEST,'messageto')) ? intval($_REQUEST['messageto']) : 0 ); - // Work around doubled linefeeds in Tinymce 3.5b2 - -/* $plaintext = intval(get_pconfig(local_user(),'system','plaintext') && !feature_enabled(local_user(),'richtext')); - if(! $plaintext) { - $body = fix_mce_lf($body); - }*/ - $plaintext = intval(!feature_enabled(local_user(),'richtext')); - if(! $plaintext) { - $body = fix_mce_lf($body); - } - $ret = send_message($recipient, $body, $subject, $replyto); $norecip = false; diff --git a/mod/parse_url.php b/mod/parse_url.php index 2c610f2751..77529714f2 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -4,13 +4,8 @@ * @file mod/parse_url.php * @brief The parse_url module * - * This module does parse an url for embedable content (audio, video, image files or link) - * information and does format this information to BBCode or html (this depends - * on the user settings - default is BBCode output). - * If the user has enabled the richtext editor setting the output will be in html - * (Note: This is not always possible and in some case not useful because - * the richtext editor doesn't support all kind of html). - * Otherwise the output will be constructed BBCode. + * This module does parse an url for embeddable content (audio, video, image files or link) + * information and does format this information to BBCode * * @see ParseUrl::getSiteinfo() for more information about scraping embeddable content */ @@ -24,13 +19,7 @@ function parse_url_content(App $a) { $text = null; $str_tags = ""; - $textmode = false; - - if (local_user() && (!feature_enabled(local_user(), "richtext"))) { - $textmode = true; - } - - $br = (($textmode) ? "\n" : "
"); + $br = "\n"; if (x($_GET,"binurl")) { $url = trim(hex2bin($_GET["binurl"])); @@ -97,11 +86,7 @@ function parse_url_content(App $a) { } } - if ($textmode) { - $template = "[bookmark=%s]%s[/bookmark]%s"; - } else { - $template = "%s%s"; - } + $template = "[bookmark=%s]%s[/bookmark]%s"; $arr = array("url" => $url, "text" => ""); @@ -118,12 +103,7 @@ function parse_url_content(App $a) { $title = str_replace(array("\r","\n"),array("",""),$title); - if ($textmode) { - $text = "[quote]" . trim($text) . "[/quote]" . $br; - } else { - $text = "
" . htmlspecialchars(trim($text)) . "

"; - $title = htmlspecialchars($title); - } + $text = "[quote]" . trim($text) . "[/quote]" . $br; $result = sprintf($template, $url, ($title) ? $title : $url, $text) . $str_tags; @@ -141,11 +121,6 @@ function parse_url_content(App $a) { // Format it as BBCode attachment $info = add_page_info_data($siteinfo); - if (!$textmode) { - // Replace ' with ’ - not perfect - but the richtext editor has problems otherwise - $info = str_replace(array("'"), array("’"), $info); - } - echo $info; killme(); diff --git a/mod/profiles.php b/mod/profiles.php index dd926d4887..d8475eeccb 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -313,19 +313,19 @@ function profiles_post(App $a) { $politic = notags(trim($_POST['politic'])); $religion = notags(trim($_POST['religion'])); - $likes = fix_mce_lf(escape_tags(trim($_POST['likes']))); - $dislikes = fix_mce_lf(escape_tags(trim($_POST['dislikes']))); - - $about = fix_mce_lf(escape_tags(trim($_POST['about']))); - $interest = fix_mce_lf(escape_tags(trim($_POST['interest']))); - $contact = fix_mce_lf(escape_tags(trim($_POST['contact']))); - $music = fix_mce_lf(escape_tags(trim($_POST['music']))); - $book = fix_mce_lf(escape_tags(trim($_POST['book']))); - $tv = fix_mce_lf(escape_tags(trim($_POST['tv']))); - $film = fix_mce_lf(escape_tags(trim($_POST['film']))); - $romance = fix_mce_lf(escape_tags(trim($_POST['romance']))); - $work = fix_mce_lf(escape_tags(trim($_POST['work']))); - $education = fix_mce_lf(escape_tags(trim($_POST['education']))); + $likes = escape_tags(trim($_POST['likes'])); + $dislikes = escape_tags(trim($_POST['dislikes'])); + + $about = escape_tags(trim($_POST['about'])); + $interest = escape_tags(trim($_POST['interest'])); + $contact = escape_tags(trim($_POST['contact'])); + $music = escape_tags(trim($_POST['music'])); + $book = escape_tags(trim($_POST['book'])); + $tv = escape_tags(trim($_POST['tv'])); + $film = escape_tags(trim($_POST['film'])); + $romance = escape_tags(trim($_POST['romance'])); + $work = escape_tags(trim($_POST['work'])); + $education = escape_tags(trim($_POST['education'])); $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0); diff --git a/mod/wall_upload.php b/mod/wall_upload.php index 82cd3652b3..1f71f36b62 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -277,16 +277,10 @@ function wall_upload_post(App $a, $desktopmode = true) { /* mod Waitman Gobble NO WARRANTY */ -//if we get the signal then return the image url info in BBCODE, otherwise this outputs the info and bails (for the ajax image uploader on wall post) + // if we get the signal then return the image url info in BBCODE if ($_REQUEST['hush']!='yeah') { - if(local_user() && (! feature_enabled(local_user(),'richtext') || x($_REQUEST['nomce'])) ) { - echo "\n\n" . '[url=' . App::get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . App::get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n"; - } - else { - echo '

getExt()."\" alt=\"$basename\" />

"; - } - } - else { + echo "\n\n" . '[url=' . App::get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . App::get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n"; + } else { $m = '[url='.App::get_baseurl().'/photos/'.$page_owner_nick.'/image/'.$hash.'][img]'.App::get_baseurl()."/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]"; return($m); } diff --git a/mod/wallmessage.php b/mod/wallmessage.php index 257ba6a898..ff90e0dbcf 100644 --- a/mod/wallmessage.php +++ b/mod/wallmessage.php @@ -43,12 +43,6 @@ function wallmessage_post(App $a) { return; } - // Work around doubled linefeeds in Tinymce 3.5b2 - - $body = str_replace("\r\n","\n",$body); - $body = str_replace("\n\n","\n",$body); - - $ret = send_wallmessage($user, $body, $subject, $replyto); switch($ret){ diff --git a/view/theme/frost-mobile/js/theme.js b/view/theme/frost-mobile/js/theme.js index 52258f0be5..a17dc1b2a4 100644 --- a/view/theme/frost-mobile/js/theme.js +++ b/view/theme/frost-mobile/js/theme.js @@ -30,7 +30,7 @@ $(document).ready(function() { if(typeof window.AjaxUpload != "undefined") { var uploader = new window.AjaxUpload( window.imageUploadButton, - { action: 'wall_upload/'+window.nickname+'?nomce=1', + { action: 'wall_upload/' + window.nickname, name: 'userfile', onSubmit: function(file,ext) { $('#profile-rotator').show(); }, onComplete: function(file,response) { @@ -43,7 +43,7 @@ $(document).ready(function() { if($('#wall-file-upload').length) { var file_uploader = new window.AjaxUpload( 'wall-file-upload', - { action: 'wall_attach/'+window.nickname+'?nomce=1', + { action: 'wall_attach/' + window.nickname, name: 'userfile', onSubmit: function(file,ext) { $('#profile-rotator').show(); }, onComplete: function(file,response) {