forked from GNUsocial/gnu-social
		
	Add site-wide option to change the length at which URLs are auto-shortened
This commit is contained in:
		
				
					committed by
					
						
						Zach Copley
					
				
			
			
				
	
			
			
			
						parent
						
							ccbc5c447d
						
					
				
				
					commit
					b416df9312
				
			
							
								
								
									
										3
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								README
									
									
									
									
									
								
							@@ -906,6 +906,9 @@ sslserver: use an alternate server name for SSL URLs, like
 | 
			
		||||
           parameters correctly so that both the SSL server and the
 | 
			
		||||
           "normal" server can access the session cookie and
 | 
			
		||||
           preferably other cookies as well.
 | 
			
		||||
shorturllength: Length of URL at which URLs in a message exceeding 140
 | 
			
		||||
                characters will be sent to the user's chosen
 | 
			
		||||
                shortening service.
 | 
			
		||||
 | 
			
		||||
db
 | 
			
		||||
--
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ class ShortUrlApi
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private function is_long($url) {
 | 
			
		||||
        return strlen($url) >= $this->long_limit;
 | 
			
		||||
        return strlen($url) >= common_config('site', 'shorturllength');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function http_post($data) {
 | 
			
		||||
 
 | 
			
		||||
@@ -120,6 +120,7 @@ $config =
 | 
			
		||||
              'private' => false,
 | 
			
		||||
              'ssl' => 'never',
 | 
			
		||||
              'sslserver' => null,
 | 
			
		||||
              'shorturllength' => 30,
 | 
			
		||||
              'dupelimit' => 60), # default for same person saying the same thing
 | 
			
		||||
        'syslog' =>
 | 
			
		||||
        array('appname' => 'laconica', # for syslog
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user