1
1
Fork 0

Merge pull request #12016 from annando/no-eol

The EOL constant is removed
This commit is contained in:
Hypolite Petovan 2022-10-18 10:16:12 -04:00 committed by GitHub
commit 33a7260c35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 38 additions and 47 deletions

View file

@ -29,15 +29,6 @@
use Friendica\Core\Session; use Friendica\Core\Session;
/**
* Constant with a HTML line break.
*
* Contains a HTML line break (br) element and a real carriage return with line
* feed for the source.
* This can be used in HTML and JavaScript where needed a line break.
*/
define('EOL', "<br />\r\n");
/** /**
* @name Gravity * @name Gravity
* *

View file

@ -66,7 +66,7 @@ function wall_attach_post(App $a) {
if ($r_json) { if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]); System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
} }
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.') . EOL ); DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
System::exit(); System::exit();
} }
@ -90,7 +90,7 @@ function wall_attach_post(App $a) {
*/ */
if ($filesize <= 0) { if ($filesize <= 0) {
$msg = DI::l10n()->t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(DI::l10n()->t('Or - did you try to upload an empty file?')); $msg = DI::l10n()->t('Sorry, maybe your upload is bigger than the PHP configuration allows') . '<br />' . (DI::l10n()->t('Or - did you try to upload an empty file?'));
@unlink($src); @unlink($src);
if ($r_json) { if ($r_json) {
System::jsonExit(['error' => $msg]); System::jsonExit(['error' => $msg]);
@ -106,7 +106,7 @@ function wall_attach_post(App $a) {
if ($r_json) { if ($r_json) {
System::jsonExit(['error' => $msg]); System::jsonExit(['error' => $msg]);
} else { } else {
echo $msg . EOL; echo $msg . '<br />';
} }
System::exit(); System::exit();
} }
@ -120,7 +120,7 @@ function wall_attach_post(App $a) {
if ($r_json) { if ($r_json) {
System::jsonExit(['error' => $msg]); System::jsonExit(['error' => $msg]);
} else { } else {
echo $msg . EOL; echo $msg . '<br />';
} }
System::exit(); System::exit();
} }

View file

@ -165,7 +165,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if ($r_json) { if ($r_json) {
System::jsonExit(['error' => $msg]); System::jsonExit(['error' => $msg]);
} else { } else {
echo $msg. EOL; echo $msg . '<br />';
} }
System::exit(); System::exit();
} }
@ -203,7 +203,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if ($r_json) { if ($r_json) {
System::jsonExit(['error' => $msg]); System::jsonExit(['error' => $msg]);
} else { } else {
echo $msg. EOL; echo $msg . '<br />';
} }
System::exit(); System::exit();
} }
@ -227,7 +227,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if ($r_json) { if ($r_json) {
System::jsonExit(['error' => $msg]); System::jsonExit(['error' => $msg]);
} else { } else {
echo $msg. EOL; echo $msg . '<br />';
} }
System::exit(); System::exit();
} }

View file

@ -261,7 +261,7 @@ class Conversation
break; break;
} }
$expanded .= "\t" . '<p class="wall-item-' . $verb . '-expanded" id="' . $verb . 'list-' . $id . '" style="display: none;" >' . $explikers . EOL . '</p>'; $expanded .= "\t" . '<p class="wall-item-' . $verb . '-expanded" id="' . $verb . 'list-' . $id . '" style="display: none;" >' . $explikers . '</p>';
} }
$o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('voting_fakelink.tpl'), [ $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('voting_fakelink.tpl'), [

View file

@ -197,7 +197,7 @@ class Installer
$result = DBStructure::install(); $result = DBStructure::install();
if ($result) { if ($result) {
$txt = DI::l10n()->t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL; $txt = DI::l10n()->t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . '<br />';
$txt .= DI::l10n()->t('Please see the file "doc/INSTALL.md".'); $txt .= DI::l10n()->t('Please see the file "doc/INSTALL.md".');
$this->addCheck($txt, false, true, htmlentities($result, ENT_COMPAT, 'UTF-8')); $this->addCheck($txt, false, true, htmlentities($result, ENT_COMPAT, 'UTF-8'));
@ -259,9 +259,9 @@ class Installer
$help = ""; $help = "";
if (!$passed) { if (!$passed) {
$help .= DI::l10n()->t('Could not find a command line version of PHP in the web server PATH.') . EOL; $help .= DI::l10n()->t('Could not find a command line version of PHP in the web server PATH.') . '<br />';
$help .= DI::l10n()->t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See <a href='https://github.com/friendica/friendica/blob/stable/doc/Install.md#set-up-the-worker'>'Setup the worker'</a>") . EOL; $help .= DI::l10n()->t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See <a href='https://github.com/friendica/friendica/blob/stable/doc/Install.md#set-up-the-worker'>'Setup the worker'</a>") . '<br />';
$help .= EOL . EOL; $help .= '<br /><br />';
$tpl = Renderer::getMarkupTemplate('field_input.tpl'); $tpl = Renderer::getMarkupTemplate('field_input.tpl');
/// @todo Separate backend Installer class and presentation layer/view /// @todo Separate backend Installer class and presentation layer/view
$help .= Renderer::replaceMacros($tpl, [ $help .= Renderer::replaceMacros($tpl, [
@ -279,7 +279,7 @@ class Installer
[$result] = explode("\n", $result); [$result] = explode("\n", $result);
$help = ""; $help = "";
if (!$passed2) { if (!$passed2) {
$help .= DI::l10n()->t("PHP executable is not the php cli binary \x28could be cgi-fgci version\x29") . EOL; $help .= DI::l10n()->t("PHP executable is not the php cli binary \x28could be cgi-fgci version\x29") . '<br />';
$help .= DI::l10n()->t('Found PHP version: ') . "<tt>$result</tt>"; $help .= DI::l10n()->t('Found PHP version: ') . "<tt>$result</tt>";
} }
$this->addCheck(DI::l10n()->t('PHP cli binary'), $passed2, true, $help); $this->addCheck(DI::l10n()->t('PHP cli binary'), $passed2, true, $help);
@ -295,7 +295,7 @@ class Installer
$passed3 = $result == $str; $passed3 = $result == $str;
$help = ""; $help = "";
if (!$passed3) { if (!$passed3) {
$help .= DI::l10n()->t('The command line version of PHP on your system does not have "register_argc_argv" enabled.') . EOL; $help .= DI::l10n()->t('The command line version of PHP on your system does not have "register_argc_argv" enabled.') . '<br />';
$help .= DI::l10n()->t('This is required for message delivery to work.'); $help .= DI::l10n()->t('This is required for message delivery to work.');
} else { } else {
$this->phppath = $phppath; $this->phppath = $phppath;
@ -333,7 +333,7 @@ class Installer
// Get private key // Get private key
if (!$res) { if (!$res) {
$help .= DI::l10n()->t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys') . EOL; $help .= DI::l10n()->t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys') . '<br />';
$help .= DI::l10n()->t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".'); $help .= DI::l10n()->t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".');
$status = false; $status = false;
} }
@ -511,10 +511,10 @@ class Installer
(!file_exists('config/local.config.php') && !is_writable('.'))) { (!file_exists('config/local.config.php') && !is_writable('.'))) {
$status = false; $status = false;
$help = DI::l10n()->t('The web installer needs to be able to create a file called "local.config.php" in the "config" folder of your web server and it is unable to do so.') . EOL; $help = DI::l10n()->t('The web installer needs to be able to create a file called "local.config.php" in the "config" folder of your web server and it is unable to do so.') . '<br />';
$help .= DI::l10n()->t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.') . EOL; $help .= DI::l10n()->t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.') . '<br />';
$help .= DI::l10n()->t('At the end of this procedure, we will give you a text to save in a file named local.config.php in your Friendica "config" folder.') . EOL; $help .= DI::l10n()->t('At the end of this procedure, we will give you a text to save in a file named local.config.php in your Friendica "config" folder.') . '<br />';
$help .= DI::l10n()->t('You can alternatively skip this procedure and perform a manual installation. Please see the file "doc/INSTALL.md" for instructions.') . EOL; $help .= DI::l10n()->t('You can alternatively skip this procedure and perform a manual installation. Please see the file "doc/INSTALL.md" for instructions.') . '<br />';
} }
$this->addCheck(DI::l10n()->t('config/local.config.php is writable'), $status, false, $help); $this->addCheck(DI::l10n()->t('config/local.config.php is writable'), $status, false, $help);
@ -537,10 +537,10 @@ class Installer
if (!is_writable('view/smarty3')) { if (!is_writable('view/smarty3')) {
$status = false; $status = false;
$help = DI::l10n()->t('Friendica uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') . EOL; $help = DI::l10n()->t('Friendica uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') . '<br />';
$help .= DI::l10n()->t('In order to store these compiled templates, the web server needs to have write access to the directory view/smarty3/ under the Friendica top level folder.') . EOL; $help .= DI::l10n()->t('In order to store these compiled templates, the web server needs to have write access to the directory view/smarty3/ under the Friendica top level folder.') . '<br />';
$help .= DI::l10n()->t("Please ensure that the user that your web server runs as \x28e.g. www-data\x29 has write access to this folder.") . EOL; $help .= DI::l10n()->t("Please ensure that the user that your web server runs as \x28e.g. www-data\x29 has write access to this folder.") . '<br />';
$help .= DI::l10n()->t("Note: as a security measure, you should give the web server write access to view/smarty3/ only--not the template files \x28.tpl\x29 that it contains.") . EOL; $help .= DI::l10n()->t("Note: as a security measure, you should give the web server write access to view/smarty3/ only--not the template files \x28.tpl\x29 that it contains.") . '<br />';
} }
$this->addCheck(DI::l10n()->t('view/smarty3 is writable'), $status, true, $help); $this->addCheck(DI::l10n()->t('view/smarty3 is writable'), $status, true, $help);
@ -571,7 +571,7 @@ class Installer
if ($fetchResult->getReturnCode() != 204) { if ($fetchResult->getReturnCode() != 204) {
$status = false; $status = false;
$help = DI::l10n()->t('Url rewrite in .htaccess seems not working. Make sure you copied .htaccess-dist to .htaccess.') . EOL; $help = DI::l10n()->t('Url rewrite in .htaccess seems not working. Make sure you copied .htaccess-dist to .htaccess.') . '<br />';
$help .= DI::l10n()->t('In some circumstances (like running inside containers), you can skip this error.'); $help .= DI::l10n()->t('In some circumstances (like running inside containers), you can skip this error.');
$error_msg = []; $error_msg = [];
$error_msg['head'] = DI::l10n()->t('Error message from Curl when fetching'); $error_msg['head'] = DI::l10n()->t('Error message from Curl when fetching');

View file

@ -150,7 +150,7 @@ class DBStructure
echo DI::l10n()->t("\nError %d occurred during database update:\n%s\n", echo DI::l10n()->t("\nError %d occurred during database update:\n%s\n",
DBA::errorNo(), DBA::errorMessage()); DBA::errorNo(), DBA::errorMessage());
return DI::l10n()->t('Errors encountered performing database changes: ') . $message . EOL; return DI::l10n()->t('Errors encountered performing database changes: ') . $message . '<br />';
} }
/** /**

View file

@ -2853,30 +2853,30 @@ class Contact
// do we have enough information? // do we have enough information?
if (empty($protocol) || ($protocol == Protocol::PHANTOM) || (empty($ret['url']) && empty($ret['addr']))) { if (empty($protocol) || ($protocol == Protocol::PHANTOM) || (empty($ret['url']) && empty($ret['addr']))) {
$result['message'] .= DI::l10n()->t('The profile address specified does not provide adequate information.') . EOL; $result['message'] .= DI::l10n()->t('The profile address specified does not provide adequate information.') . '<br />';
if (empty($ret['poll'])) { if (empty($ret['poll'])) {
$result['message'] .= DI::l10n()->t('No compatible communication protocols or feeds were discovered.') . EOL; $result['message'] .= DI::l10n()->t('No compatible communication protocols or feeds were discovered.') . '<br />';
} }
if (empty($ret['name'])) { if (empty($ret['name'])) {
$result['message'] .= DI::l10n()->t('An author or name was not found.') . EOL; $result['message'] .= DI::l10n()->t('An author or name was not found.') . '<br />';
} }
if (empty($ret['url'])) { if (empty($ret['url'])) {
$result['message'] .= DI::l10n()->t('No browser URL could be matched to this address.') . EOL; $result['message'] .= DI::l10n()->t('No browser URL could be matched to this address.') . '<br />';
} }
if (strpos($ret['url'], '@') !== false) { if (strpos($ret['url'], '@') !== false) {
$result['message'] .= DI::l10n()->t('Unable to match @-style Identity Address with a known protocol or email contact.') . EOL; $result['message'] .= DI::l10n()->t('Unable to match @-style Identity Address with a known protocol or email contact.') . '<br />';
$result['message'] .= DI::l10n()->t('Use mailto: in front of address to force email check.') . EOL; $result['message'] .= DI::l10n()->t('Use mailto: in front of address to force email check.') . '<br />';
} }
return $result; return $result;
} }
if ($protocol === Protocol::OSTATUS && DI::config()->get('system', 'ostatus_disabled')) { if ($protocol === Protocol::OSTATUS && DI::config()->get('system', 'ostatus_disabled')) {
$result['message'] .= DI::l10n()->t('The profile address specified belongs to a network which has been disabled on this site.') . EOL; $result['message'] .= DI::l10n()->t('The profile address specified belongs to a network which has been disabled on this site.') . '<br />';
$ret['notify'] = ''; $ret['notify'] = '';
} }
if (!$ret['notify']) { if (!$ret['notify']) {
$result['message'] .= DI::l10n()->t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL; $result['message'] .= DI::l10n()->t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . '<br />';
} }
$writeable = ((($protocol === Protocol::OSTATUS) && ($ret['notify'])) ? 1 : 0); $writeable = ((($protocol === Protocol::OSTATUS) && ($ret['notify'])) ? 1 : 0);
@ -2935,7 +2935,7 @@ class Contact
$contact = DBA::selectFirst('contact', [], ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]); $contact = DBA::selectFirst('contact', [], ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]);
if (!DBA::isResult($contact)) { if (!DBA::isResult($contact)) {
$result['message'] .= DI::l10n()->t('Unable to retrieve contact information.') . EOL; $result['message'] .= DI::l10n()->t('Unable to retrieve contact information.') . '<br />';
return $result; return $result;
} }

View file

@ -994,7 +994,7 @@ class User
try { try {
$authurl = $openid->authUrl(); $authurl = $openid->authUrl();
} catch (Exception $e) { } catch (Exception $e) {
throw new Exception(DI::l10n()->t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . EOL . EOL . DI::l10n()->t('The error message was:') . $e->getMessage(), 0, $e); throw new Exception(DI::l10n()->t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . '<br />' . DI::l10n()->t('The error message was:') . $e->getMessage(), 0, $e);
} }
System::externalRedirect($authurl); System::externalRedirect($authurl);
// NOTREACHED // NOTREACHED

View file

@ -337,7 +337,7 @@ class Install extends BaseModule
if (count($this->installer->getChecks()) == 0) { if (count($this->installer->getChecks()) == 0) {
$txt = '<p style="font-size: 130%;">'; $txt = '<p style="font-size: 130%;">';
$txt .= $this->t('Your Friendica site database has been installed.') . EOL; $txt .= $this->t('Your Friendica site database has been installed.') . '<br />';
$db_return_text .= $txt; $db_return_text .= $txt;
} }

View file

@ -41,8 +41,8 @@ class ItemCCEMail extends Email
$disclaimer = '<hr />' . $l10n->t('This message was sent to you by %s, a member of the Friendica social network.', $user['username']) $disclaimer = '<hr />' . $l10n->t('This message was sent to you by %s, a member of the Friendica social network.', $user['username'])
. '<br />'; . '<br />';
$disclaimer .= $l10n->t('You may visit them online at %s', $baseUrl . '/profile/' . $a->getLoggedInUserNickname()) . EOL; $disclaimer .= $l10n->t('You may visit them online at %s', $baseUrl . '/profile/' . $a->getLoggedInUserNickname()) . '<br />';
$disclaimer .= $l10n->t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL; $disclaimer .= $l10n->t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . '<br />';
if (!$item['title'] == '') { if (!$item['title'] == '') {
$subject = $item['title']; $subject = $item['title'];
} else { } else {