4 Commits a75b1df627 ... aa004d03aa

Author SHA1 Message Date
  Mikael Nordfeldth aa004d03aa Merge branch 'master' of git.gnu.io:gnu/gnu-social into mmn_fixes 6 years ago
  mmn 7785219234 Merge branch 'fix-doc-twitterapi' into 'master' 6 years ago
  Mikael Nordfeldth 56e2b0007c Issue #279 raises the point of missing newlines 6 years ago
  MIYAGI Hikaru b9a4053eec fix a link of doc/twitterapi 6 years ago
2 changed files with 4 additions and 1 deletions
  1. 1 1
      doc-src/twitterapi
  2. 3 0
      lib/util.php

+ 1 - 1
doc-src/twitterapi

@@ -14,7 +14,7 @@ check out [Beginner’s Guide to OAuth](http://hueniverse.com/oauth/)).
 
 To use OAuth, you'll need to register your client application via the web interface
 and obtain a consumer key and secret. You can find the interface for application
-registration at [http://%%site.server%%/%%site.path%%settings/oauthapps](http://%%site.server%%/%%site.path%%settings/oauthapps).
+registration at [%%action.oauthappssettings%%](%%action.oauthappssettings%%).
 
 ## JSONP callbacks
 

+ 3 - 0
lib/util.php

@@ -2611,6 +2611,9 @@ function common_log_delta($comment=null)
 
 function common_strip_html($html, $trim=true, $save_whitespace=false)
 {
+    // first replace <br /> with \n
+    $html = preg_replace('/\<(\s*)?br(\s*)?\/?(\s*)?\>/i', "\n", $html); 
+    // then, unless explicitly avoided, remove excessive whitespace
     if (!$save_whitespace) {
         $html = preg_replace('/\s+/', ' ', $html);
     }