}
function defaultfeatures_plugin_admin_post (&$a) {
- check_form_security_token_redirectOnErr('/admin/plugins/defaultfeatures', 'admin_themes');
+ check_form_security_token_redirectOnErr('/admin/plugins/defaultfeatures', 'defaultfeaturessave');
foreach($_POST as $k => $v) {
if(strpos($k,'feature_') === 0) {
set_config('defaultfeatures',substr($k,8),((intval($v)) ? 1 : 0));
function defaultfeatures_plugin_admin (&$a, &$o) {
$t = get_markup_template( "admin.tpl", "addon/defaultfeatures/" );
+ $token = get_form_security_token("defaultfeaturessave");
$arr = array();
$features = get_features();
foreach($features as $fname => $fdata) {
$o = replace_macros($t, array(
'$submit' => t('Submit'),
- '$features' => $arr
+ '$features' => $arr,
+ '$form_security_token' => $token
));
}
$link = current($links);
}
$multiplelinks = (sizeof($links) > 1);
+
+ if ($multiplelinks) {
+ $html2 = bbcode($msg, false, false);
+ $links2 = collecturls($html2);
+ if (sizeof($links2) > 0) {
+ reset($links2);
+ $link = current($links2);
+ $multiplelinks = (sizeof($links2) > 1);
+ }
+ }
}
$msglink = "";
$title = $lines[0];
}
- if ($image != $msglink)
- $html = trim(str_replace($msglink, "", $html));
+ //if ($image != $msglink)
+ // $html = trim(str_replace($msglink, "", $html));
$title = trim(str_replace($msglink, "", $title));
if ($uid == 0)
$title = $item["author-name"].": ".$title;
+ $msglink = htmlspecialchars(html_entity_decode($msglink));
+
$title = str_replace("&", "&", $title);
//$html = str_replace("&", "&", $html);
while (strpos($msg, " ") !== false)
$msg = str_replace(" ", " ", $msg);
+ $origmsg = $msg;
+
// Removing URLs
$msg = preg_replace('/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/i', "", $msg);
if (($msglink == "") and strlen($msg) > $max_char)
$msglink = $b["plink"];
+ // If the message is short enough then don't modify it. (if the link exists in the original message)
+ if ((strlen(trim($origmsg)) <= $max_char) AND (strpos($origmsg, $msglink) OR ($msglink == "")))
+ return(array("msg"=>trim($origmsg), "image"=>""));
+
if (strlen($msglink) > 20)
$msglink = short_link($msglink);
while (strpos($msg, " ") !== false)
$msg = str_replace(" ", " ", $msg);
+ $origmsg = $msg;
+
// Removing URLs
$msg = preg_replace('/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/i', "", $msg);
if (($msglink == "") and strlen($msg) > $max_char)
$msglink = $b["plink"];
+ // If the message is short enough then don't modify it. (if the link exists in the original message)
+ if ((strlen(trim($origmsg)) <= $max_char) AND (strpos($origmsg, $msglink) OR ($msglink == "")))
+ return(trim($origmsg));
+
if (strlen($msglink) > 20)
$msglink = short_link($msglink);