mirror of
https://github.com/friendica/friendica
synced 2025-04-26 19:50:10 +00:00
Worker priority / no shadow worker
This commit is contained in:
parent
e076998ffe
commit
592ac53ffc
5 changed files with 13 additions and 56 deletions
|
@ -2325,7 +2325,7 @@ class Item
|
|||
* @param integer $itemid Item ID that should be added
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function addShadow($itemid)
|
||||
private static function addShadow($itemid)
|
||||
{
|
||||
$fields = ['uid', 'private', 'moderated', 'visible', 'deleted', 'network', 'uri'];
|
||||
$condition = ['id' => $itemid, 'parent' => [0, $itemid]];
|
||||
|
@ -2388,7 +2388,7 @@ class Item
|
|||
* @param integer $itemid Item ID that should be added
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function addShadowPost($itemid)
|
||||
private static function addShadowPost($itemid)
|
||||
{
|
||||
$item = self::selectFirst(self::ITEM_FIELDLIST, ['id' => $itemid]);
|
||||
if (!DBA::isResult($item)) {
|
||||
|
@ -2470,6 +2470,10 @@ class Item
|
|||
// Remove possibly remaining links
|
||||
$naked_body = preg_replace(Strings::autoLinkRegEx(), '', $naked_body);
|
||||
|
||||
if (empty($naked_body)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$ld = new Language(DI::l10n()->getAvailableLanguages());
|
||||
$languages = $ld->detect($naked_body)->limit(0, 3)->close();
|
||||
if (is_array($languages)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue