diff --git a/include/functions.php b/include/functions.php
index e9fcbed7..13d4e8ad 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -216,10 +216,6 @@ function formatAdUrl($adid, $url, $content, $newWindow=true)
return formatUrl("adredir.php?id=".$adid."&url=".rawurlencode($url), $newWindow, $content);
}
function formatUrl($url, $newWindow = false, $text = '', $linkClass = '') {
- //Exclude youtube, because [youtube] bbcode
- if (str_contains($url, 'youtube')) {
- return $url;
- }
if (!$text) {
$text = $url;
}
diff --git a/nexus/Field/Field.php b/nexus/Field/Field.php
index 034b99ad..02a219e8 100644
--- a/nexus/Field/Field.php
+++ b/nexus/Field/Field.php
@@ -267,9 +267,9 @@ HEAD;
$name = "custom_fields[{$row['id']}]";
$currentValue = $customValues[$row['id']]['custom_field_value'] ?? '';
if ($row['type'] == self::TYPE_TEXT) {
- $html .= tr($row['label'], sprintf('', $name, $currentValue), 1);
+ $html .= tr($row['label'], sprintf('', $name, $currentValue, '99%'), 1);
} elseif ($row['type'] == self::TYPE_TEXTAREA) {
- $html .= tr($row['label'], sprintf('', $name, $currentValue), 1);
+ $html .= tr($row['label'], sprintf('', $name, '99%', $currentValue), 1);
} elseif ($row['type'] == self::TYPE_RADIO || $row['type'] == self::TYPE_CHECKBOX) {
if ($row['type'] == self::TYPE_CHECKBOX) {
$name .= '[]';
@@ -320,7 +320,7 @@ HEAD;
$imgId = "attach" . $row['id'];
$previewBoxId = "preview_$callbackFunc";
$y = '';
- $y .= sprintf('', $inputId, $name, $currentValue);
+ $y .= sprintf('', $inputId, $name, $currentValue, '99%');
$y .= '
';
if (!empty($currentValue)) {
if (substr($currentValue, 0, 4) == 'http') {
@@ -406,16 +406,16 @@ JS;
{
global $browsecatmode;
$displayName = get_searchbox_value($browsecatmode, 'custom_fields_display_name');
- $display = get_searchbox_value($browsecatmode, 'custom_fields_display');
$customFields = $this->listTorrentCustomField($torrentId);
- $mixedRowContent = nl2br($display);
+ $mixedRowContent = get_searchbox_value($browsecatmode, 'custom_fields_display');
$rowByRowHtml = '';
foreach ($customFields as $field) {
- $content = $this->formatCustomFieldValue($field);
+ $contentNotFormatted = $this->formatCustomFieldValue($field, false);
$mixedRowContent = str_replace("<%{$field['name']}.label%>", $field['label'], $mixedRowContent);
- $mixedRowContent = str_replace("<%{$field['name']}.value%>", $content, $mixedRowContent);
+ $mixedRowContent = str_replace("<%{$field['name']}.value%>", $contentNotFormatted, $mixedRowContent);
if ($field['is_single_row']) {
- $rowByRowHtml .= tr($field['label'], $content, 1);
+ $contentFormatted = $this->formatCustomFieldValue($field, true);
+ $rowByRowHtml .= tr($field['label'], $contentFormatted, 1);
}
}
$result = $rowByRowHtml;
@@ -427,20 +427,20 @@ JS;
- protected function formatCustomFieldValue(array $customFieldWithValue)
+ protected function formatCustomFieldValue(array $customFieldWithValue, $doFormatComment = false): string
{
$result = '';
$fieldValue = $customFieldWithValue['custom_field_value'];
switch ($customFieldWithValue['type']) {
case self::TYPE_TEXT:
case self::TYPE_TEXTAREA:
- $result .= format_comment($fieldValue);
+ $result .= $doFormatComment ? format_comment($fieldValue) : $fieldValue;
break;
case self::TYPE_IMAGE:
if (substr($fieldValue, 0, 4) == 'http') {
- $result .= formatImg($fieldValue, true, 700, 0, "attach{$customFieldWithValue['id']}");
+ $result .= $doFormatComment ? formatImg($fieldValue, true, 700, 0, "attach{$customFieldWithValue['id']}") : $fieldValue;
} else {
- $result .= format_comment($fieldValue);
+ $result .= $doFormatComment ? format_comment($fieldValue) : $fieldValue;
}
break;
case self::TYPE_RADIO: