]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '0.9.x' into 1.0.x
authorBrion Vibber <brion@pobox.com>
Fri, 30 Apr 2010 20:15:53 +0000 (13:15 -0700)
committerBrion Vibber <brion@pobox.com>
Fri, 30 Apr 2010 20:16:13 +0000 (13:16 -0700)
Conflicts:
lib/util.php

1  2 
README
index.php
lib/common.php
lib/util.php

diff --cc README
Simple merge
diff --cc index.php
Simple merge
diff --cc lib/common.php
Simple merge
diff --cc lib/util.php
index 1f3aaf711a2969eba2e5fb383f47f82414139e85,e0669a1d56c976a8b3de99dcec1905dd4c47e73a..e7ea9df61395264cbabb84d3f3794d701c60fda6
@@@ -826,23 -855,11 +855,23 @@@ function common_linkify($url) 
      return XMLStringer::estring('a', $attrs, $url);
  }
  
- function common_shorten_links($text)
+ function common_shorten_links($text, $always = false)
  {
 -    $maxLength = Notice::maxContent();
 -    if (!$always && ($maxLength == 0 || mb_strlen($text) <= $maxLength)) return $text;
 -    return common_replace_urls_callback($text, array('File_redirection', 'makeShort'));
 +    common_debug("common_shorten_links() called");
 +
 +    $user = common_current_user();
 +
 +    $maxLength = User_urlshortener_prefs::maxNoticeLength($user);
 +
 +    common_debug("maxLength = $maxLength");
 +
-     if (mb_strlen($text) > $maxLength) {
++    if ($always || mb_strlen($text) > $maxLength) {
 +        common_debug("Forcing shortening");
 +        return common_replace_urls_callback($text, array('File_redirection', 'forceShort'));
 +    } else {
 +        common_debug("Not forcing shortening");
 +        return common_replace_urls_callback($text, array('File_redirection', 'makeShort'));
 +    }
  }
  
  function common_xml_safe_str($str)