use DOMDocument;
use DOMXPath;
+use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
+use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Util\Network;
use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Strings;
use Friendica\Util\XML;
use League\HTMLToMarkdown\HtmlConverter;
*
* @param string $s
*/
- public static function htmlToBBVideo($s)
+ public static function toBBCodeVideo($s)
{
$s = preg_replace(
'#<object[^>]+>(.*?)https?://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+)(.*?)</object>#ism',
public static function micropro($contact, $redirect = false, $class = '', $textmode = false)
{
// Use the contact URL if no address is available
- if (!x($contact, "addr")) {
+ if (empty($contact['addr'])) {
$contact["addr"] = $contact["url"];
}
}
// If there is some js available we don't need the url
- if (x($contact, 'click')) {
+ if (!empty($contact['click'])) {
$url = '';
}
*
* @return string Formatted HTML.
*/
- public static function search($s, $id = 'search-box', $url = 'search', $save = false, $aside = true)
+ public static function search($s, $id = 'search-box', $url = 'search', $aside = true)
{
$mode = 'text';
$save_label = $mode === 'text' ? L10n::t('Save') : L10n::t('Follow');
$values = [
- '$s' => htmlspecialchars($s),
+ '$s' => $s,
'$id' => $id,
'$action_url' => $url,
'$search_label' => L10n::t('Search'),
'$save_label' => $save_label,
- '$savedsearch' => local_user() && Feature::isEnabled(local_user(), 'savedsearch'),
+ '$savedsearch' => 'savedsearch',
'$search_hint' => L10n::t('@name, !forum, #tags, content'),
'$mode' => $mode
];
$tpl = Renderer::getMarkupTemplate('wall/content_filter.tpl');
$html = Renderer::replaceMacros($tpl, [
'$reasons' => $reasons,
- '$rnd' => random_string(8),
+ '$rnd' => Strings::getRandomHex(8),
'$openclose' => L10n::t('Click to open/close'),
'$html' => $html
]);