Fix http:// url handling

master
teknomunk 11 months ago
parent 7161566b78
commit ea19e6eefc

@ -38,13 +38,14 @@ char* status_render_source( struct status* s, const char* default_server )
for( char* i = s->source; *i; ++i ) {
// Handle URLs
if( 0 == strncmp( i, "https://", 8 ) ) {
if( ( 0 == strncmp( i, "https://", 8 ) ) || ( 0 == strncmp( i, "http://", 7 ) ) ) {
char* start = i;
while( *i && !index(" ,\r\n\t",*i) ) ++i;
char* url = strndup( start, i - start );
fprintf( f, "<a href='%s' rel='ugc'>%s</a>", url, url );
free(url);
} else if( isalpha(i[1]) && *i == '@' ) {
char* start = i;
while( *i && !index(" ,\r\n",*i) ) ++i;

Loading…
Cancel
Save