Check-in [813fd2005d]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Redirect /tag to /
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | scgi
Files: files | file ages | folders
SHA1:813fd2005d587a613c5bce8c4644747ee118fdb6
User & Date: bapt 2015-04-23 14:49:14
Context
2015-04-23
14:52
Fix redirect on tags check-in: a0cc2d2dda user: bapt tags: scgi
14:49
Redirect /tag to / check-in: 813fd2005d user: bapt tags: scgi
14:47
Redirect /post to / check-in: e75b1fb47d user: bapt tags: scgi
Changes

Changes to web/cblogweb.c.

426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
...
452
453
454
455
456
457
458
459
460


461


462
463
464
465
466
467
468
	sqlite3_open(ucl_get_string(conf,"db_path"), &sqlite);
	if (criteria.timefmt == NULL)
		criteria.timefmt = ucl_get_string(conf, "dateformat");

	reqpath = r.path;
	switch (type) {
		case CBLOG_POST:
			warnx("ixi %d", type);
			reqpath++;
			while (*reqpath && *reqpath != '/')
				reqpath++;
			if (*reqpath == '\0') {
				type = CBLOG_POST_REDIRECT;
				reqpath = "/";
				break;
			}

			reqpath++;

			if (comment == CBLOG_COMMENT_POST) {
				//set_comment(&h, reqpath, hdf_get_value(out, "antispamres", NULL), sqlite);
				type = CBLOG_POST_REDIRECT;
				break;
			}
................................................................................
				asprintf(&err_msg, "Unknown post: %s", reqpath);
				ucl_object_insert_key(out, ucl_object_fromstring(err_msg), "err_msg", 0, false);
				type = CBLOG_ERR;
			}
			break;
		case CBLOG_TAG:
			reqpath++;
			while (reqpath[0] != '/')
				reqpath++;


			reqpath++;


			criteria.type = CRITERIA_TAGNAME;
			criteria.tagname = reqpath;
			build_index(&r, conf, out, &criteria, sqlite);
			break;
		case CBLOG_ATOM:
			criteria.feed = true;
			build_index(&r, conf, out, &criteria, sqlite);







<








<







 







|

>
>
|
>
>







426
427
428
429
430
431
432

433
434
435
436
437
438
439
440

441
442
443
444
445
446
447
...
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
	sqlite3_open(ucl_get_string(conf,"db_path"), &sqlite);
	if (criteria.timefmt == NULL)
		criteria.timefmt = ucl_get_string(conf, "dateformat");

	reqpath = r.path;
	switch (type) {
		case CBLOG_POST:

			reqpath++;
			while (*reqpath && *reqpath != '/')
				reqpath++;
			if (*reqpath == '\0') {
				type = CBLOG_POST_REDIRECT;
				reqpath = "/";
				break;
			}

			reqpath++;

			if (comment == CBLOG_COMMENT_POST) {
				//set_comment(&h, reqpath, hdf_get_value(out, "antispamres", NULL), sqlite);
				type = CBLOG_POST_REDIRECT;
				break;
			}
................................................................................
				asprintf(&err_msg, "Unknown post: %s", reqpath);
				ucl_object_insert_key(out, ucl_object_fromstring(err_msg), "err_msg", 0, false);
				type = CBLOG_ERR;
			}
			break;
		case CBLOG_TAG:
			reqpath++;
			while (*reqpath && *reqpath != '/')
				reqpath++;
			if (*reqpath == '\0') {
				type = CBLOG_POST_REDIRECT;
				reqpath = "/";
				break;
			}
			criteria.type = CRITERIA_TAGNAME;
			criteria.tagname = reqpath;
			build_index(&r, conf, out, &criteria, sqlite);
			break;
		case CBLOG_ATOM:
			criteria.feed = true;
			build_index(&r, conf, out, &criteria, sqlite);