Subversion Repositories RepoView

Rev

Rev 44 | Rev 47 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 44 Rev 46
Line 1... Line 1...
1
/* $Id: modern.c 44 2024-08-22 05:52:32Z nishi $ */
1
/* $Id: modern.c 46 2024-08-22 05:54:18Z nishi $ */
2
 
2
 
3
#include "rv_query.h"
3
#include "rv_query.h"
4
 
4
 
5
#include "rv_util.h"
5
#include "rv_util.h"
6
#include "rv_version.h"
6
#include "rv_version.h"
Line 36... Line 36...
36
 
36
 
37
char* title = NULL;
37
char* title = NULL;
38
char* desc = NULL;
38
char* desc = NULL;
39
char* page = NULL;
39
char* page = NULL;
40
char* nav = NULL;
40
char* nav = NULL;
41
char* logo = NULL;
41
char* logopath = NULL;
42
char* grepouser;
42
char* grepouser;
43
extern char* user;
43
extern char* user;
44
 
44
 
45
bool invalid_char(char c) {
45
bool invalid_char(char c) {
46
	if(c >= '0' && c <= '9') return false;
46
	if(c >= '0' && c <= '9') return false;
Line 795... Line 795...
795
					buf[s.st_size] = 0;
795
					buf[s.st_size] = 0;
796
 
796
 
797
					desc = html_escape_nl_to_br(buf);
797
					desc = html_escape_nl_to_br(buf);
798
 
798
 
799
					char* tmp = rv_strcat3(WWW_AVATAR_ROOT, "/", rv_get_query("username"));
799
					char* tmp = rv_strcat3(WWW_AVATAR_ROOT, "/", rv_get_query("username"));
800
					logo = rv_strcat(tmp, ".png");
800
					logopath = rv_strcat(tmp, ".png");
801
					free(tmp);
801
					free(tmp);
802
 
802
 
803
					fclose(f);
803
					fclose(f);
804
				}
804
				}
805
				free(path);
805
				free(path);
Line 859... Line 859...
859
freeall:
859
freeall:
860
	free(page);
860
	free(page);
861
	free(desc);
861
	free(desc);
862
	free(title);
862
	free(title);
863
	free(nav);
863
	free(nav);
864
	if(logo != NULL) free(logo);
864
	if(logopath != NULL) free(logopath);
865
}
865
}
866
 
866
 
867
char* escape(const char* str) {
867
char* escape(const char* str) {
868
	char* r = malloc(1);
868
	char* r = malloc(1);
869
	r[0] = 0;
869
	r[0] = 0;
Line 1086... Line 1086...
1086
	add_data(&buffer, "				<p>\n");
1086
	add_data(&buffer, "				<p>\n");
1087
	add_data(&buffer, desc);
1087
	add_data(&buffer, desc);
1088
	add_data(&buffer, "				</p>\n");
1088
	add_data(&buffer, "				</p>\n");
1089
	add_data(&buffer, "			</div>\n");
1089
	add_data(&buffer, "			</div>\n");
1090
	add_data(&buffer, "			<img id=\"logo\" src=\"");
1090
	add_data(&buffer, "			<img id=\"logo\" src=\"");
1091
	if(logo != NULL) {
1091
	if(logopath != NULL) {
1092
		add_data(&buffer, logo);
1092
		add_data(&buffer, logopath);
1093
	} else {
1093
	} else {
1094
		add_data(&buffer, INSTANCE_LOGO);
1094
		add_data(&buffer, INSTANCE_LOGO);
1095
	}
1095
	}
1096
	add_data(&buffer, "\" height=\"128px\" alt=\"logo\">\n");
1096
	add_data(&buffer, "\" height=\"128px\" alt=\"logo\">\n");
1097
	add_data(&buffer, "		</div>\n");
1097
	add_data(&buffer, "		</div>\n");