From projeler-commits at pardus.org.tr Wed Aug 1 13:45:59 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Wed, 1 Aug 2007 13:45:59 +0300 (EEST) Subject: [Projeler-commits] r405 - in iksemel: . src Message-ID: <20070801104559.D2BE17C0042@liste.uludag.org.tr> Author: gurer Date: Wed Aug 1 13:45:59 2007 New Revision: 405 Modified: iksemel/ChangeLog iksemel/src/base64.c Log: padding fix Modified: iksemel/ChangeLog ================================================================= --- iksemel/ChangeLog (original) +++ iksemel/ChangeLog Wed Aug 1 13:45:59 2007 @@ -1,3 +1,7 @@ +2007-08-01 Gurer + * Patch from Benjamin Bennett: + base64.c: fix padding + 2006-05-19 Gurer * dom.c: fixed (size % FILE_IO_BUFFER_SIZE) problem in iks_load() Modified: iksemel/src/base64.c ================================================================= --- iksemel/src/base64.c (original) +++ iksemel/src/base64.c Wed Aug 1 13:45:59 2007 @@ -13,22 +13,24 @@ char *iks_base64_decode(const char *buf) { - char *res, *save,val; + char *res, *save; + char val; const char *foo; const char *end; int index; + size_t len; if (!buf) return NULL; - index = iks_strlen(buf)*6 / 8 + 1; - save = res = iks_malloc(index); - memset(res, 0, index); - index = 0; + len = iks_strlen(buf) * 6 / 8 + 1; + save = res = iks_malloc(len); if (!save) return NULL; + memset(res, 0, len); + index = 0; end = buf + iks_strlen(buf); while (*buf && buf < end) { @@ -67,6 +69,7 @@ len = (len > 0) ? (len) : (iks_strlen(buf)); save = res = iks_malloc((len*8) / 6 + 4); + if (!save) return NULL; for (k = 0; k < len/3; ++k) { *res++ = base64_charset[*buf >> 2]; @@ -86,14 +89,15 @@ buf++; *res++ = base64_charset[t | (*buf >> 4)]; *res++ = base64_charset[((*buf++ & 0x0F) << 2)]; + *res++ = '='; break; case 1: *res++ = base64_charset[*buf >> 2]; *res++ = base64_charset[(*buf++ & 0x03) << 4]; + *res++ = '='; + *res++ = '='; break; } - *res++ = '='; - *res++ = '='; *res = 0; return save; } From projeler-commits at pardus.org.tr Wed Aug 1 14:15:26 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Wed, 1 Aug 2007 14:15:26 +0300 (EEST) Subject: [Projeler-commits] r406 - in iksemel: . src Message-ID: <20070801111526.687CF7C004B@liste.uludag.org.tr> Author: gurer Date: Wed Aug 1 14:15:26 2007 New Revision: 406 Modified: iksemel/ChangeLog iksemel/src/sha.c Log: 64bit fix Modified: iksemel/ChangeLog ================================================================= --- iksemel/ChangeLog (original) +++ iksemel/ChangeLog Wed Aug 1 14:15:26 2007 @@ -1,6 +1,7 @@ 2007-08-01 Gurer * Patch from Benjamin Bennett: base64.c: fix padding + * sha.c: 64bit fix (long -> int) 2006-05-19 Gurer * dom.c: fixed (size % FILE_IO_BUFFER_SIZE) problem in iks_load() Modified: iksemel/src/sha.c ================================================================= --- iksemel/src/sha.c (original) +++ iksemel/src/sha.c Wed Aug 1 14:15:26 2007 @@ -11,10 +11,10 @@ static void sha_calculate (iksha *sha); struct iksha_struct { - unsigned long hash[5]; - unsigned long buf[80]; + unsigned int hash[5]; + unsigned int buf[80]; int blen; - unsigned long lenhi, lenlo; + unsigned int lenhi, lenlo; }; iksha * @@ -32,11 +32,11 @@ iks_sha_reset (iksha *sha) { memset (sha, 0, sizeof (iksha)); - sha->hash[0] = 0x67452301L; - sha->hash[1] = 0xefcdab89L; - sha->hash[2] = 0x98badcfeL; - sha->hash[3] = 0x10325476L; - sha->hash[4] = 0xc3d2e1f0L; + sha->hash[0] = 0x67452301; + sha->hash[1] = 0xefcdab89; + sha->hash[2] = 0x98badcfe; + sha->hash[3] = 0x10325476; + sha->hash[4] = 0xc3d2e1f0; } void @@ -74,7 +74,7 @@ for (i=0; i<5; i++) { - sprintf (hash, "%08lx", sha->hash[i]); + sprintf (hash, "%08x", sha->hash[i]); hash += 8; } } @@ -103,7 +103,7 @@ for (i=0; ibuf[sha->blen / 4] <<= 8; - sha->buf[sha->blen / 4] |= (unsigned long)data[i]; + sha->buf[sha->blen / 4] |= (unsigned int)data[i]; if ((++sha->blen) % 64 == 0) { sha_calculate (sha); sha->blen = 0; @@ -128,7 +128,7 @@ sha_calculate (iksha *sha) { int i; - unsigned long A, B, C, D, E, TMP; + unsigned int A, B, C, D, E, TMP; for (i=16; i<80; i++) sha->buf[i] = SRL (sha->buf[i-3] ^ sha->buf[i-8] ^ sha->buf[i-14] ^ sha->buf[i-16], 1); @@ -139,10 +139,10 @@ D = sha->hash[3]; E = sha->hash[4]; - SHA (0, 19, ((C^D)&B)^D, 0x5a827999L); - SHA (20, 39, B^C^D, 0x6ed9eba1L); - SHA (40, 59, (B&C)|(D&(B|C)), 0x8f1bbcdcL); - SHA (60, 79, B^C^D, 0xca62c1d6L); + SHA (0, 19, ((C^D)&B)^D, 0x5a827999); + SHA (20, 39, B^C^D, 0x6ed9eba1); + SHA (40, 59, (B&C)|(D&(B|C)), 0x8f1bbcdc); + SHA (60, 79, B^C^D, 0xca62c1d6); sha->hash[0] += A; sha->hash[1] += B; From projeler-commits at pardus.org.tr Wed Aug 1 17:58:06 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Wed, 1 Aug 2007 17:58:06 +0300 (EEST) Subject: [Projeler-commits] r407 - iksemel/src Message-ID: <20070801145806.41DD27C004C@liste.uludag.org.tr> Author: gurer Date: Wed Aug 1 17:58:05 2007 New Revision: 407 Modified: iksemel/src/sax.c Log: better comment Modified: iksemel/src/sax.c ================================================================= --- iksemel/src/sax.c (original) +++ iksemel/src/sax.c Wed Aug 1 17:58:05 2007 @@ -149,7 +149,8 @@ if (need < prs->stack_max) { need = prs->stack_max * 2; } else { - need = prs->stack_max + (/*need * 1.2 [NO FP ON ARM]*/ (need * 6) / 5); + /* need x 1.2 for integer only archs like ARM */ + need = prs->stack_max + ( (need * 6) / 5); } tmp = iks_malloc (need); if (!tmp) return 0; From projeler-commits at pardus.org.tr Wed Aug 1 18:33:32 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Wed, 1 Aug 2007 18:33:32 +0300 (EEST) Subject: [Projeler-commits] r408 - in iksemel: . include src Message-ID: <20070801153332.1666086493F@liste.uludag.org.tr> Author: gurer Date: Wed Aug 1 18:33:31 2007 New Revision: 408 Modified: iksemel/ChangeLog iksemel/include/iksemel.h iksemel/src/dom.c iksemel/src/iks.c Log: new functions Modified: iksemel/ChangeLog ================================================================= --- iksemel/ChangeLog (original) +++ iksemel/ChangeLog Wed Aug 1 18:33:31 2007 @@ -2,6 +2,8 @@ * Patch from Benjamin Bennett: base64.c: fix padding * sha.c: 64bit fix (long -> int) + * iks.c: new funcs: iks_append, iks_prepend + iks_append_cdata, iks_prepend_cdata 2006-05-19 Gurer * dom.c: fixed (size % FILE_IO_BUFFER_SIZE) problem in iks_load() Modified: iksemel/include/iksemel.h ================================================================= --- iksemel/include/iksemel.h (original) +++ iksemel/include/iksemel.h Wed Aug 1 18:33:31 2007 @@ -60,6 +60,10 @@ iks *iks_insert_cdata (iks *x, const char *data, size_t len); iks *iks_insert_attrib (iks *x, const char *name, const char *value); iks *iks_insert_node (iks *x, iks *y); +iks *iks_append (iks *x, const char *name); +iks *iks_prepend (iks *x, const char *name); +iks *iks_append_cdata (iks *x, const char *data, size_t len); +iks *iks_prepend_cdata (iks *x, const char *data, size_t len); void iks_hide (iks *x); void iks_delete (iks *x); iks *iks_next (iks *x); Modified: iksemel/src/dom.c ================================================================= --- iksemel/src/dom.c (original) +++ iksemel/src/dom.c Wed Aug 1 18:33:31 2007 @@ -37,6 +37,8 @@ } if (IKS_CLOSE == type || IKS_SINGLE == type) { x = iks_parent (data->current); + if (iks_strcmp(iks_name(data->current), name) != 0) + return IKS_BADXML; if (x) data->current = x; else { @@ -132,7 +134,7 @@ ret = IKS_FILE_RWERR; break; } - if (0 == len) ret = IKS_OK; + if (0 == len) ret = IKS_OK; done = 1; } if (len > 0) { Modified: iksemel/src/iks.c ================================================================= --- iksemel/src/iks.c (original) +++ iksemel/src/iks.c Wed Aug 1 18:33:31 2007 @@ -183,6 +183,106 @@ return y; } +iks * +iks_append (iks *x, const char *name) +{ + iks *y; + + if (!x) return NULL; + y = iks_new_within (name, x->s); + if (!y) return NULL; + + if (x->next) { + x->next->prev = y; + } else { + IKS_TAG_LAST_CHILD (x->parent) = y; + } + y->next = x->next; + x->next = y; + y->parent = x->parent; + y->prev = x; + + return y; +} + +iks * +iks_prepend (iks *x, const char *name) +{ + iks *y; + + if (!x) return NULL; + y = iks_new_within (name, x->s); + if (!y) return NULL; + + if (x->prev) { + x->prev->next = y; + } else { + IKS_TAG_CHILDREN (x->parent) = y; + } + y->prev = x->prev; + x->prev = y; + y->parent = x->parent; + y->next = x; + + return y; +} + +iks * +iks_append_cdata (iks *x, const char *data, size_t len) +{ + iks *y; + + if (!x || !data) return NULL; + if (len == 0) len = strlen (data); + + y = iks_new_within (NULL, x->s); + if (!y) return NULL; + y->type = IKS_CDATA; + IKS_CDATA_CDATA (y) = iks_stack_strdup (x->s, data, len); + if (!IKS_CDATA_CDATA (y)) return NULL; + IKS_CDATA_LEN (y) = len; + + if (x->next) { + x->next->prev = y; + } else { + IKS_TAG_LAST_CHILD (x->parent) = y; + } + y->next = x->next; + x->next = y; + y->parent = x->parent; + y->prev = x; + + return y; +} + +iks * +iks_prepend_cdata (iks *x, const char *data, size_t len) +{ + iks *y; + + if (!x || !data) return NULL; + if (len == 0) len = strlen (data); + + y = iks_new_within (NULL, x->s); + if (!y) return NULL; + y->type = IKS_CDATA; + IKS_CDATA_CDATA(y) = iks_stack_strdup (x->s, data, len); + if (!IKS_CDATA_CDATA (y)) return NULL; + IKS_CDATA_LEN (y) = len; + + if (x->prev) { + x->prev->next = y; + } else { + IKS_TAG_CHILDREN (x->parent) = y; + } + y->prev = x->prev; + x->prev = y; + y->parent = x->parent; + y->next = x; + + return y; +} + void iks_hide (iks *x) { From projeler-commits at pardus.org.tr Wed Aug 1 23:09:47 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Wed, 1 Aug 2007 23:09:47 +0300 (EEST) Subject: [Projeler-commits] r409 - in iksemel: . src Message-ID: <20070801200947.6CC997C0029@liste.uludag.org.tr> Author: gurer Date: Wed Aug 1 23:09:47 2007 New Revision: 409 Modified: iksemel/ChangeLog iksemel/src/stream.c Log: code cleanup in iks_sasl_challenge Modified: iksemel/ChangeLog ================================================================= --- iksemel/ChangeLog (original) +++ iksemel/ChangeLog Wed Aug 1 23:09:47 2007 @@ -4,6 +4,9 @@ * sha.c: 64bit fix (long -> int) * iks.c: new funcs: iks_append, iks_prepend iks_append_cdata, iks_prepend_cdata + * stream.c: iks_sasl_challenge split into smaller functions + This change also fixes some possible leaks which are detected + by Coverity Inc's excellent Prevent product. 2006-05-19 Gurer * dom.c: fixed (size % FILE_IO_BUFFER_SIZE) problem in iks_load() Modified: iksemel/src/stream.c ================================================================= --- iksemel/src/stream.c (original) +++ iksemel/src/stream.c Wed Aug 1 23:09:47 2007 @@ -122,106 +122,143 @@ #define CNONCE_LEN 4 static void -iks_sasl_challenge (struct stream_data *data, iks *challenge) +parse_digest (char *message, const char *key, char **value_ptr, char **value_end_ptr) { - char *b; - iks *x; + char *t; - b = iks_cdata (iks_child (challenge)); - if (!b) return; + *value_ptr = NULL; + *value_end_ptr = NULL; - b = iks_base64_decode (b); + t = strstr(message, key); + if (t) { + t += strlen(key); + *value_ptr = t; + while (t[0] != '\0') { + if (t[0] != '\\' && t[1] == '"') { + ++t; + *value_end_ptr = t; + return; + } + ++t; + } + } +} - if (strstr (b, "rspauth")) { - x = iks_new("response"); +static iks * +make_sasl_response (struct stream_data *data, char *message) +{ + iks *x = NULL; + char *realm, *realm_end; + char *nonce, *nonce_end; + char cnonce[CNONCE_LEN*8 + 1]; + iksmd5 *md5; + unsigned char a1_h[16], a1[33], a2[33], response_value[33]; + char *response, *response_coded; + int i; + + parse_digest(message, "realm=\"", &realm, &realm_end); + parse_digest(message, "nonce=\"", &nonce, &nonce_end); + + /* nonce is necessary for auth */ + if (!nonce || !nonce_end) return NULL; + *nonce_end = '\0'; + + /* if no realm is given use the server hostname */ + if (realm) { + if (!realm_end) return NULL; + *realm_end = '\0'; } else { - char *realm, *nonce, *charset = NULL, *algorithm = NULL; - char *realm_end, *nonce_end, cnonce[CNONCE_LEN*8 + 1]; - unsigned char a1_h[16], a1[33], a2[33], response_value[33]; - char *response, *response_coded; - iksmd5 *md5; - int i; - - realm = strstr (b, "realm"); - if (realm) { - realm += 7; - do { - realm_end = strchr(realm, '"'); - } while (*(realm_end - 1) == '\\'); - } else { - realm_end = 0; - realm = (char *) data->server; - } - nonce = strstr (b, "nonce"); - if (nonce) { - nonce += 7; - do { - nonce_end = strchr (nonce, '"'); - } while (*(nonce - 1) == '\\'); - } else { - iks_free (b); - return; - } - charset = strstr (b, "charset"); - if (charset) charset += 8; - algorithm = strstr (b, "algorithm"); - if (algorithm) algorithm += 10; - if (realm_end) *realm_end = 0; - *nonce_end = 0; - - for (i = 0; i < CNONCE_LEN; ++i) - sprintf (cnonce + i*8, "%08x", rand()); - - md5 = iks_md5_new(); - iks_md5_hash (md5, (const unsigned char*)data->auth_username, iks_strlen (data->auth_username), 0); - iks_md5_hash (md5, (const unsigned char*)":", 1, 0); - iks_md5_hash (md5, (const unsigned char*)realm, iks_strlen (realm), 0); - iks_md5_hash (md5, (const unsigned char*)":", 1, 0); - iks_md5_hash (md5, (const unsigned char*)data->auth_pass, iks_strlen (data->auth_pass), 1); - iks_md5_digest (md5, a1_h); - iks_md5_reset (md5); - iks_md5_hash (md5, (const unsigned char*)a1_h, 16, 0); - iks_md5_hash (md5, (const unsigned char*)":", 1, 0); - iks_md5_hash (md5, (const unsigned char*)nonce, iks_strlen (nonce), 0); - iks_md5_hash (md5, (const unsigned char*)":", 1, 0); - iks_md5_hash (md5, (const unsigned char*)cnonce, iks_strlen (cnonce), 1); - iks_md5_print (md5, (char*)a1); - iks_md5_reset (md5); - iks_md5_hash (md5, (const unsigned char*)"AUTHENTICATE:xmpp/", 18, 0); - iks_md5_hash (md5, (const unsigned char*)data->server, iks_strlen (data->server), 1); - iks_md5_print (md5, (char*)a2); - iks_md5_reset (md5); - iks_md5_hash (md5, (const unsigned char*)a1, 32, 0); - iks_md5_hash (md5, (const unsigned char*)":", 1, 0); - iks_md5_hash (md5, (const unsigned char*)nonce, iks_strlen (nonce), 0); - iks_md5_hash (md5, (const unsigned char*)":00000001:", 10, 0); - iks_md5_hash (md5, (const unsigned char*)cnonce, iks_strlen (cnonce), 0); - iks_md5_hash (md5, (const unsigned char*)":auth:", 6, 0); - iks_md5_hash (md5, (const unsigned char*)a2, 32, 1); - iks_md5_print (md5, (char*)response_value); - iks_md5_delete (md5); - - i = iks_strlen (data->auth_username) + iks_strlen (realm) + - iks_strlen (nonce) + iks_strlen (data->server) + - CNONCE_LEN*8 + 136; - response = iks_malloc (i); - sprintf (response, "username=\"%s\",realm=\"%s\",nonce=\"%s\"" - ",cnonce=\"%s\",nc=00000001,qop=auth,digest-uri=\"" - "xmpp/%s\",response=%s,charset=utf-8", - data->auth_username, realm, nonce, cnonce, - data->server, response_value); - response_coded = iks_base64_encode (response, 0); + realm = (char *) data->server; + } + + /* generate random client challenge */ + for (i = 0; i < CNONCE_LEN; ++i) + sprintf (cnonce + i*8, "%08x", rand()); + + md5 = iks_md5_new(); + if (!md5) return NULL; + + iks_md5_hash (md5, (const unsigned char*)data->auth_username, iks_strlen (data->auth_username), 0); + iks_md5_hash (md5, (const unsigned char*)":", 1, 0); + iks_md5_hash (md5, (const unsigned char*)realm, iks_strlen (realm), 0); + iks_md5_hash (md5, (const unsigned char*)":", 1, 0); + iks_md5_hash (md5, (const unsigned char*)data->auth_pass, iks_strlen (data->auth_pass), 1); + iks_md5_digest (md5, a1_h); + + iks_md5_reset (md5); + iks_md5_hash (md5, (const unsigned char*)a1_h, 16, 0); + iks_md5_hash (md5, (const unsigned char*)":", 1, 0); + iks_md5_hash (md5, (const unsigned char*)nonce, iks_strlen (nonce), 0); + iks_md5_hash (md5, (const unsigned char*)":", 1, 0); + iks_md5_hash (md5, (const unsigned char*)cnonce, iks_strlen (cnonce), 1); + iks_md5_print (md5, (char*)a1); + + iks_md5_reset (md5); + iks_md5_hash (md5, (const unsigned char*)"AUTHENTICATE:xmpp/", 18, 0); + iks_md5_hash (md5, (const unsigned char*)data->server, iks_strlen (data->server), 1); + iks_md5_print (md5, (char*)a2); + + iks_md5_reset (md5); + iks_md5_hash (md5, (const unsigned char*)a1, 32, 0); + iks_md5_hash (md5, (const unsigned char*)":", 1, 0); + iks_md5_hash (md5, (const unsigned char*)nonce, iks_strlen (nonce), 0); + iks_md5_hash (md5, (const unsigned char*)":00000001:", 10, 0); + iks_md5_hash (md5, (const unsigned char*)cnonce, iks_strlen (cnonce), 0); + iks_md5_hash (md5, (const unsigned char*)":auth:", 6, 0); + iks_md5_hash (md5, (const unsigned char*)a2, 32, 1); + iks_md5_print (md5, (char*)response_value); + + iks_md5_delete (md5); + + i = iks_strlen (data->auth_username) + iks_strlen (realm) + + iks_strlen (nonce) + iks_strlen (data->server) + + CNONCE_LEN*8 + 136; + response = iks_malloc (i); + if (!response) return NULL; + + sprintf (response, "username=\"%s\",realm=\"%s\",nonce=\"%s\"" + ",cnonce=\"%s\",nc=00000001,qop=auth,digest-uri=\"" + "xmpp/%s\",response=%s,charset=utf-8", + data->auth_username, realm, nonce, cnonce, + data->server, response_value); + response_coded = iks_base64_encode (response, 0); + if (response_coded) { x = iks_new ("response"); iks_insert_cdata (x, response_coded, 0); - - iks_free (response); iks_free (response_coded); } - iks_insert_attrib (x, "xmlns", IKS_NS_XMPP_SASL); - iks_send (data->prs, x); - iks_delete (x); - iks_free (b); + iks_free (response); + + return x; +} + +static void +iks_sasl_challenge (struct stream_data *data, iks *challenge) +{ + char *message; + iks *x; + char *tmp; + + tmp = iks_cdata (iks_child (challenge)); + if (!tmp) return; + + /* decode received blob */ + message = iks_base64_decode (tmp); + if (!message) return; + + /* reply the challenge */ + if (strstr (message, "rspauth")) { + x = iks_new ("response"); + } else { + x = make_sasl_response (data, message); + } + if (x) { + iks_insert_attrib (x, "xmlns", IKS_NS_XMPP_SASL); + iks_send (data->prs, x); + iks_delete (x); + } + iks_free (message); } static int From projeler-commits at pardus.org.tr Wed Aug 1 23:18:44 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Wed, 1 Aug 2007 23:18:44 +0300 (EEST) Subject: [Projeler-commits] r410 - in iksemel: include src Message-ID: <20070801201844.98E1D7C0027@liste.uludag.org.tr> Author: gurer Date: Wed Aug 1 23:18:44 2007 New Revision: 410 Modified: iksemel/include/iksemel.h iksemel/src/iks.c iksemel/src/stream.c Log: update (c) years Modified: iksemel/include/iksemel.h ================================================================= --- iksemel/include/iksemel.h (original) +++ iksemel/include/iksemel.h Wed Aug 1 23:18:44 2007 @@ -1,5 +1,5 @@ /* iksemel (XML parser for Jabber) -** Copyright (C) 2000-2004 Gurer Ozen +** Copyright (C) 2000-2007 Gurer Ozen ** This code is free software; you can redistribute it and/or ** modify it under the terms of GNU Lesser General Public License. */ Modified: iksemel/src/iks.c ================================================================= --- iksemel/src/iks.c (original) +++ iksemel/src/iks.c Wed Aug 1 23:18:44 2007 @@ -1,5 +1,5 @@ /* iksemel (XML parser for Jabber) -** Copyright (C) 2000-2004 Gurer Ozen +** Copyright (C) 2000-2007 Gurer Ozen ** This code is free software; you can redistribute it and/or ** modify it under the terms of GNU Lesser General Public License. */ Modified: iksemel/src/stream.c ================================================================= --- iksemel/src/stream.c (original) +++ iksemel/src/stream.c Wed Aug 1 23:18:44 2007 @@ -1,5 +1,5 @@ /* iksemel (XML parser for Jabber) -** Copyright (C) 2000-2004 Gurer Ozen +** Copyright (C) 2000-2007 Gurer Ozen ** This code is free software; you can redistribute it and/or ** modify it under the terms of GNU Lesser General Public License. */ From projeler-commits at pardus.org.tr Thu Aug 2 12:19:37 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Thu, 2 Aug 2007 12:19:37 +0300 (EEST) Subject: [Projeler-commits] r411 - in iksemel: . test Message-ID: <20070802091937.6415A7C0027@liste.uludag.org.tr> Author: gurer Date: Thu Aug 2 12:19:36 2007 New Revision: 411 Modified: iksemel/ChangeLog iksemel/test/tst-iks.c Log: leziz Modified: iksemel/ChangeLog ================================================================= --- iksemel/ChangeLog (original) +++ iksemel/ChangeLog Thu Aug 2 12:19:36 2007 @@ -1,3 +1,6 @@ +2007-08-02 Gurer + * tst-iks.c: test for new append/prepend functions added. + 2007-08-01 Gurer * Patch from Benjamin Bennett: base64.c: fix padding Modified: iksemel/test/tst-iks.c ================================================================= --- iksemel/test/tst-iks.c (original) +++ iksemel/test/tst-iks.c Thu Aug 2 12:19:36 2007 @@ -17,6 +17,8 @@ "" "TestClientSuxOS 2000" "1.2.0 patchlevel 2"; + static char xml2[] = + "lala
Hello World
"; iks *x, *y, *z; char *t; @@ -52,5 +54,24 @@ } iks_delete(x); + + x = iks_new ("Ni"); + y = iks_insert (x, "br"); + z = iks_prepend_cdata (y, "lala", 4); + iks_prepend (z, "C"); + z = iks_insert_cdata (x, "Hello", 5); + y = iks_append (z, "B"); + iks_prepend (z, "A"); + iks_append_cdata (z, " ", 1); + iks_prepend_cdata (y, "World", 5); + + t = iks_string (iks_stack (x), x); + if(!t || strcmp(t, xml2) != 0) { + printf("Result: %s\n", t); + printf("Expected: %s\n", xml2); + return 1; + } + iks_delete(x); + return 0; } From projeler-commits at pardus.org.tr Thu Aug 2 13:11:33 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Thu, 2 Aug 2007 13:11:33 +0300 (EEST) Subject: [Projeler-commits] r412 - iksemel Message-ID: <20070802101133.862807C002F@liste.uludag.org.tr> Author: gurer Date: Thu Aug 2 13:11:33 2007 New Revision: 412 Modified: iksemel/NEWS Log: haberler Modified: iksemel/NEWS ================================================================= --- iksemel/NEWS (original) +++ iksemel/NEWS Thu Aug 2 13:11:33 2007 @@ -1,3 +1,22 @@ +V1.3 (2007-08-xx) +* Project is moved to + http://code.google.com/p/iksemel/ + there is also a new mailing list at: + http://groups.google.com/group/iksemel + Please use those instead of old jabberstudio.org addresses. +* iksemel is now participating in Coverity Inc's free software + quality improvement program (http://scan.coverity.com). As a + first result, a few problems found by Coverity's static analysis + tool in the iks_sasl_challenge() are fixed in this release, and + other than that, iksemel passes from defect test with no problems. +* Extra padding problem in the base64 encoder is fixed. Some servers + were having problems with extra '=' padded SASL digests. +* New dom functions: iks_append(), iks_prepend(), iks_append_cdata(), + iks_prepend_cdata(). You can append/prepend new nodes within the + siblings with them, insert_ functions were only appending at the + last child. Thus editing a tree is much easier now. +* iks_load was giving error on files with multiply of 4Kb sizes, fixed. + V1.2 (2004-08-06) * SASL authentication. * SSH connections via gnutls library. From projeler-commits at pardus.org.tr Thu Aug 2 13:35:39 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Thu, 2 Aug 2007 13:35:39 +0300 (EEST) Subject: [Projeler-commits] r413 - in iksemel: . src Message-ID: <20070802103539.75C2A7C003F@liste.uludag.org.tr> Author: gurer Date: Thu Aug 2 13:35:39 2007 New Revision: 413 Modified: iksemel/NEWS iksemel/src/Makefile.am Log: bump Modified: iksemel/NEWS ================================================================= --- iksemel/NEWS (original) +++ iksemel/NEWS Thu Aug 2 13:35:39 2007 @@ -1,4 +1,4 @@ -V1.3 (2007-08-xx) +V1.3 (2007-08-02) * Project is moved to http://code.google.com/p/iksemel/ there is also a new mailing list at: Modified: iksemel/src/Makefile.am ================================================================= --- iksemel/src/Makefile.am (original) +++ iksemel/src/Makefile.am Thu Aug 2 13:35:39 2007 @@ -24,6 +24,6 @@ md5.c \ base64.c -libiksemel_la_LDFLAGS = -version-info 3:1:0 -no-undefined +libiksemel_la_LDFLAGS = -version-info 4:0:1 -no-undefined libiksemel_la_CFLAGS = $(CFLAGS) $(LIBGNUTLS_CFLAGS) libiksemel_la_LIBADD = $(LIBGNUTLS_LIBS) From projeler-commits at pardus.org.tr Fri Aug 10 20:27:42 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Fri, 10 Aug 2007 20:27:42 +0300 (EEST) Subject: [Projeler-commits] r414 - iksemel Message-ID: <20070810172742.189227C001E@liste.uludag.org.tr> Author: gurer Date: Fri Aug 10 20:27:41 2007 New Revision: 414 Modified: iksemel/ChangeLog iksemel/README iksemel/configure.ac Log: bump Modified: iksemel/ChangeLog ================================================================= --- iksemel/ChangeLog (original) +++ iksemel/ChangeLog Fri Aug 10 20:27:41 2007 @@ -1,3 +1,6 @@ +2007-08-10 Gurer + * version bump to 1.4 after the release + 2007-08-02 Gurer * tst-iks.c: test for new append/prepend functions added. Modified: iksemel/README ================================================================= --- iksemel/README (original) +++ iksemel/README Fri Aug 10 20:27:41 2007 @@ -1,7 +1,7 @@ - iksemel 1.3 + iksemel 1.4 -Copyright (c) 2000-2004 Gurer Ozen +Copyright (c) 2000-2007 Gurer Ozen Introduction: Modified: iksemel/configure.ac ================================================================= --- iksemel/configure.ac (original) +++ iksemel/configure.ac Fri Aug 10 20:27:41 2007 @@ -2,7 +2,7 @@ AC_INIT AC_PREREQ(2.50) AC_CONFIG_SRCDIR([configure.ac]) -AM_INIT_AUTOMAKE(iksemel,1.3) +AM_INIT_AUTOMAKE(iksemel,1.4) AM_CONFIG_HEADER(include/config.h) AC_CANONICAL_HOST From projeler-commits at pardus.org.tr Fri Aug 17 00:32:37 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Fri, 17 Aug 2007 00:32:37 +0300 (EEST) Subject: [Projeler-commits] r415 - in zangetsu/blog: . templatetags Message-ID: <20070816213237.F2A917C006D@liste.uludag.org.tr> Author: meren Date: Fri Aug 17 00:32:37 2007 New Revision: 415 Modified: zangetsu/blog/templatetags/library.py zangetsu/blog/urls.py zangetsu/blog/views.py Log: ileri tarihli entry'leri vakti gelene kadar hiç bir yerde gösterme. Modified: zangetsu/blog/templatetags/library.py ================================================================= --- zangetsu/blog/templatetags/library.py (original) +++ zangetsu/blog/templatetags/library.py Fri Aug 17 00:32:37 2007 @@ -8,6 +8,10 @@ from zangetsu.blog.models import Entry, Tag, Link from zangetsu.settings import WEB_URL +import datetime + +Now = datetime.datetime.now + register = Library() class TemplateSyntaxError(Exception): @@ -38,7 +42,7 @@ class MonthMenuObject(Node): def render(self, context): - context["blog_months"] = Entry.objects.dates("pubdate", "month", "DESC") + context["blog_months"] = Entry.objects.filter(pubdate__lte=Now()).dates("pubdate", "month", "DESC") return "" class TagMenuObject(Node): Modified: zangetsu/blog/urls.py ================================================================= --- zangetsu/blog/urls.py (original) +++ zangetsu/blog/urls.py Fri Aug 17 00:32:37 2007 @@ -4,12 +4,16 @@ # Licensed under the GNU General Public License, version 2. # See the file http://www.gnu.org/copyleft/gpl.txt. +import datetime + from django.conf.urls.defaults import * from zangetsu.blog.feeds import RssFeed, AtomFeed from zangetsu.blog.models import Entry +Now = datetime.datetime.now + info_dict = { - "queryset": Entry.objects.all(), + "queryset": Entry.objects.filter(pubdate__lte=Now()), "date_field": "pubdate", } @@ -31,7 +35,7 @@ (r"^entry/(?P\d+)/$", "django.views.generic.list_detail.object_detail", - {"queryset": Entry.objects.all()} + {"queryset": Entry.objects.filter(pubdate__lte=Now())} ), (r"^feed/(?P.*)/$", Modified: zangetsu/blog/views.py ================================================================= --- zangetsu/blog/views.py (original) +++ zangetsu/blog/views.py Fri Aug 17 00:32:37 2007 @@ -4,11 +4,14 @@ # Licensed under the GNU General Public License, version 2. # See the file http://www.gnu.org/copyleft/gpl.txt. +import datetime + from django.shortcuts import render_to_response from django.db.models import get_apps from zangetsu.blog.models import Entry, Tag from django.core.paginator import ObjectPaginator, InvalidPage +Now = datetime.datetime.now def build_paginator_dict(results, page, item_per_page): paginator_result = ObjectPaginator(results, item_per_page) @@ -29,7 +32,7 @@ def search(request): try: search_term = request.GET["s"] - search_results = Entry.objects.filter(content__icontains=search_term) | Entry.objects.filter(title__icontains=search_term).order_by("-pubdate") + search_results = Entry.objects.filter(content__icontains=search_term) | Entry.objects.filter(title__icontains=search_term,pubdate__lte=Now()).order_by("-pubdate") except: search_results = None @@ -47,7 +50,7 @@ entries = [] for tag in Tag.objects.all(): if tag.__str__() == slug: - entries = tag.entry_set.order_by("-pubdate") + entries = tag.entry_set.filter(pubdate__lte=Now()).order_by("-pubdate") paginator_dict = build_paginator_dict(entries, int(page), 10) response_dict = {'url_tip': '/tag/%s/page/' % slug} response_dict.update(paginator_dict) @@ -65,7 +68,7 @@ return render_to_response("blog/recent_comments.html", response_dict) def all_entries(request, page = 0): - entry_list = Entry.objects.order_by("-pubdate") + entry_list = Entry.objects.filter(pubdate__lte=Now()).order_by("-pubdate") paginator_dict = build_paginator_dict(entry_list, int(page), 20) response_dict = {'url_tip': '/page/'} response_dict.update(paginator_dict) From projeler-commits at pardus.org.tr Fri Aug 24 23:32:26 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Fri, 24 Aug 2007 23:32:26 +0300 (EEST) Subject: [Projeler-commits] r416 - zangetsu/templates/blog Message-ID: <20070824203226.1D2927C0066@liste.uludag.org.tr> Author: meren Date: Fri Aug 24 23:32:25 2007 New Revision: 416 Modified: zangetsu/templates/blog/entry_detail.html Log: isim boşluğunda şakaya mahal vermeyelim. Modified: zangetsu/templates/blog/entry_detail.html ================================================================= --- zangetsu/templates/blog/entry_detail.html (original) +++ zangetsu/templates/blog/entry_detail.html Fri Aug 24 23:32:25 2007 @@ -27,7 +27,7 @@ {% if comment.approved %} {% if comment.is_public %} {% endif %} {% endif %} From projeler-commits at pardus.org.tr Sat Aug 25 17:12:06 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Sat, 25 Aug 2007 17:12:06 +0300 (EEST) Subject: [Projeler-commits] r419 - zangetsu/blog/templatetags Message-ID: <20070825141206.C0A8F7C0143@liste.uludag.org.tr> Author: meren Date: Sat Aug 25 17:12:06 2007 New Revision: 419 Modified: zangetsu/blog/templatetags/library.py zangetsu/blog/templatetags/sanitize_html.py Log: fix Modified: zangetsu/blog/templatetags/library.py ================================================================= --- zangetsu/blog/templatetags/library.py (original) +++ zangetsu/blog/templatetags/library.py Sat Aug 25 17:12:06 2007 @@ -3,7 +3,8 @@ # Copyright © 2006, 2007 TUBITAK/UEKAE # Licensed under the GNU General Public License, version 2. # See the file http://www.gnu.org/copyleft/gpl.txt. -from django.template import Library,Node +from django.template import Library,Node,Context +from django.template.loader import get_template from zangetsu.blog import defaults from zangetsu.blog.models import Entry, Tag, Link from zangetsu.settings import WEB_URL @@ -17,6 +18,32 @@ class TemplateSyntaxError(Exception): pass +class TagCloudObject(Node): + def render(self, context): + tags = {} + tag_objects = Tag.objects.all() + for tag in tag_objects: + tags[tag.title] = len(tag.entry_set.all()) + + def sort_func(x, y): + return cmp(x[1], y[1]) + + items = tags.items() + items.sort(sort_func) + items.reverse() + top = items[0][1] + tag_cloud = "" + tmpl = get_template("blog/tag_cloud_item.tmpl") + for item in [items[i] for i in range(len(items), 0, -1) if i % 2] + [items[i] for i in range(0, len(items)) if not i % 2]: + values = {"tag_title": item[0], + "entry_count": item[1], + "cloud_level": str(item[1]*9/top + 1), + "tag_link": "%s/blog/tag/%s/" % (WEB_URL, item[0])} + tag_cloud += tmpl.render(Context(values)) + context["tag_cloud"] = tag_cloud + return "" + + class BlogNameObject(Node): def render(self, context): context["blog_name"] = defaults.BLOG_NAME @@ -53,6 +80,9 @@ def build_blog_name(parser, token): return BlogNameObject() +def build_tag_cloud(parser, token): + return TagCloudObject() + def build_link_list(parser, token): return LinkMenuObject() @@ -63,6 +93,7 @@ return TagMenuObject() register.tag("build_blog_name", build_blog_name) +register.tag("build_tag_cloud", build_tag_cloud) register.tag("build_link_list", build_link_list) register.tag("build_month_list", build_month_list) register.tag("build_tag_list", build_tag_list) Modified: zangetsu/blog/templatetags/sanitize_html.py ================================================================= --- zangetsu/blog/templatetags/sanitize_html.py (original) +++ zangetsu/blog/templatetags/sanitize_html.py Sat Aug 25 17:12:06 2007 @@ -1,12 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -from django.template import Library - import re +from django.template import Library from BeautifulSoup import BeautifulSoup, Comment +register = Library() def remove_pattern(pattern, value): """Case insensitive 'search & destroy' function""" @@ -44,4 +44,4 @@ return remove_javascript(value) -register.filter('santize', sanitize_html) +register.filter('sanitize', sanitize_html) From projeler-commits at pardus.org.tr Sat Aug 25 17:17:11 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Sat, 25 Aug 2007 17:17:11 +0300 (EEST) Subject: [Projeler-commits] r420 - zangetsu/templates/blog Message-ID: <20070825141711.237A97C00DB@liste.uludag.org.tr> Author: meren Date: Sat Aug 25 17:17:10 2007 New Revision: 420 Modified: zangetsu/templates/blog/entry_detail.html zangetsu/templates/blog/recent_comments.html Log: newline karakterini br'ye çevirmeyi, url'leri adam etmeyi ihmal etmeyelim. Modified: zangetsu/templates/blog/entry_detail.html ================================================================= --- zangetsu/templates/blog/entry_detail.html (original) +++ zangetsu/templates/blog/entry_detail.html Sat Aug 25 17:17:10 2007 @@ -31,7 +31,7 @@ #{{ forloop.counter }}   {{ comment.person_name|striptags|escape }} {%trans "commented"%} {{ comment.submit_date|date:"d F y, l" }} @ {{ comment.submit_date|date:"H:i" }}
- {{ comment.comment|sanitize }} + {{ comment.comment|linebreaks|urlizetrunc:40|sanitize }} {%endif%} {%endif%} Modified: zangetsu/templates/blog/recent_comments.html ================================================================= --- zangetsu/templates/blog/recent_comments.html (original) +++ zangetsu/templates/blog/recent_comments.html Sat Aug 25 17:17:10 2007 @@ -15,7 +15,7 @@ {{ comment.person_name|striptags|escape }} - {{comment.get_content_object.title}} {%trans "commented"%} {{ comment.submit_date|date:"d F y, l" }} @ {{ comment.submit_date|date:"H:i" }}
- {{ comment.comment|sanitize }} + {{ comment.comment|linebreaks|urlizetrunc:40|sanitize }} {% endif %} {% endif %} From projeler-commits at pardus.org.tr Sat Aug 25 20:51:55 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Sat, 25 Aug 2007 20:51:55 +0300 (EEST) Subject: [Projeler-commits] r421 - in zangetsu: blog blog/templatetags templates/blog Message-ID: <20070825175155.3BB257C00E3@liste.uludag.org.tr> Author: meren Date: Sat Aug 25 20:51:54 2007 New Revision: 421 Added: zangetsu/blog/templatetags/filters.py - copied, changed from r420, zangetsu/blog/templatetags/sanitize_html.py Removed: zangetsu/blog/templatetags/sanitize_html.py Modified: zangetsu/blog/defaults-dist-default.py zangetsu/templates/blog/entry_detail.html zangetsu/templates/blog/recent_comments.html Log: - sanitize'ı biraz toparla. bu commit ile beraer blog/defaults-dist-default.py'nin içeriği değişti! dolayısıyla doğrudan svn up yapanlar daha sonra kendi blog/defaults.py kopyalarına yeni eklenen içeriği yansıtmalılar. Modified: zangetsu/blog/defaults-dist-default.py ================================================================= --- zangetsu/blog/defaults-dist-default.py (original) +++ zangetsu/blog/defaults-dist-default.py Sat Aug 25 20:51:54 2007 @@ -31,3 +31,7 @@ """ # Google Analytics tracker code (ex: UA-12345-6) GOOGLE_ANALYTICS=None + +# Allowed tags and attributes for HTML formatted comments: +VALID_TAGS = "em p i hr span font strong b u a h1 h2 h3 pre br img" +VALID_ATTRS = "href src class width size noshade face size color style align title hspace vspace" Copied: zangetsu/blog/templatetags/filters.py (from r420, zangetsu/blog/templatetags/sanitize_html.py) ================================================================= --- zangetsu/blog/templatetags/sanitize_html.py (original) +++ zangetsu/blog/templatetags/filters.py Sat Aug 25 20:51:54 2007 @@ -3,30 +3,31 @@ import re +from zangetsu.blog import defaults from django.template import Library from BeautifulSoup import BeautifulSoup, Comment register = Library() -def remove_pattern(pattern, value): - """Case insensitive 'search & destroy' function""" - for match in re.findall(pattern, value, re.IGNORECASE): - value = value.replace(match, "") - return value - -def remove_javascript(value): - """Remove 'javascript:' method from attribute.""" - for ci in [0, 9, 10, 13]: - value = remove_pattern("�*%s;" % ci, value) - value = remove_pattern("�*%s;" % hex(ci)[2:], value) - value = value.replace(chr(ci), "") - value = remove_pattern("javascript:", value) - return value - -def sanitize_html(value): +def sanitize(value): """Sanitize HTML - http://www.djangosnippets.org/snippets/205/""" - valid_tags = 'p i strong b u a h1 h2 h3 pre br img'.split() - valid_attrs = 'href src'.split() + def remove_pattern(pattern, value): + """Case insensitive 'search & destroy' function""" + for match in re.findall(pattern, value, re.IGNORECASE): + value = value.replace(match, "") + return value + + def remove_javascript(value): + """Remove 'javascript:' method from attribute.""" + for ci in [0, 9, 10, 13]: + value = remove_pattern("�*%s;" % ci, value) + value = remove_pattern("�*%s;" % hex(ci)[2:], value) + value = value.replace(chr(ci), "") + value = remove_pattern("javascript:", value) + return value + + valid_tags = defaults.VALID_TAGS.split() + valid_attrs = defaults.VALID_ATTRS.split() soup = BeautifulSoup(value) for comment in soup.findAll(text=lambda text: isinstance(text, Comment)): comment.extract() @@ -40,8 +41,8 @@ if not val.startswith("&"): attrs_ok.append((attr, val)) tag.attrs = attrs_ok - value = soup.renderContents().decode('utf8') + value = soup.renderContents().decode("utf8") return remove_javascript(value) -register.filter('sanitize', sanitize_html) +register.filter("sanitize", sanitize) Modified: zangetsu/templates/blog/entry_detail.html ================================================================= --- zangetsu/templates/blog/entry_detail.html (original) +++ zangetsu/templates/blog/entry_detail.html Sat Aug 25 20:51:54 2007 @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load comments %} {% load library %} -{% load sanitize_html %} +{% load filters %} {% load i18n %} {% block title %} - {{ object.title }}{% endblock %} Modified: zangetsu/templates/blog/recent_comments.html ================================================================= --- zangetsu/templates/blog/recent_comments.html (original) +++ zangetsu/templates/blog/recent_comments.html Sat Aug 25 20:51:54 2007 @@ -1,5 +1,5 @@ {% load library %} -{% load sanitize_html %} +{% load filters %} {% load i18n %} {% extends "base.html" %} {% block content %} From projeler-commits at pardus.org.tr Mon Aug 27 11:42:22 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Mon, 27 Aug 2007 11:42:22 +0300 (EEST) Subject: [Projeler-commits] r422 - in PSP/pspsdk-headers: . files Message-ID: <20070827084222.6567E7C0101@liste.uludag.org.tr> Author: caglar Date: Mon Aug 27 11:42:22 2007 New Revision: 422 Added: PSP/pspsdk-headers/files/ PSP/pspsdk-headers/files/pspsdk.patch Modified: PSP/pspsdk-headers/pspec.xml Log: bump to rev2302 Modified: PSP/pspsdk-headers/pspec.xml ================================================================= --- PSP/pspsdk-headers/pspec.xml (original) +++ PSP/pspsdk-headers/pspec.xml Mon Aug 27 11:42:22 2007 @@ -16,6 +16,10 @@ gcc-psp + + <-- rev 2238-2302 --> + pspsdk.patch + @@ -29,6 +33,13 @@ + + 2007-08-27 + 2302 + Bump. + S.Çağlar Onur + caglar at pardus.org.tr + 2007-05-21 2228 From projeler-commits at pardus.org.tr Mon Aug 27 11:48:28 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Mon, 27 Aug 2007 11:48:28 +0300 (EEST) Subject: [Projeler-commits] r423 - PSP/newlib-psp/files Message-ID: <20070827084828.338437C00D4@liste.uludag.org.tr> Author: caglar Date: Mon Aug 27 11:48:27 2007 New Revision: 423 Modified: PSP/newlib-psp/files/newlib-1.15.0-PSP.patch Log: bump Modified: PSP/newlib-psp/files/newlib-1.15.0-PSP.patch ================================================================= Suppressed! Too long (more than 250 lines) diff output suppressed... From projeler-commits at pardus.org.tr Mon Aug 27 12:07:39 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Mon, 27 Aug 2007 12:07:39 +0300 (EEST) Subject: [Projeler-commits] r424 - in PSP/pspsdk: . files Message-ID: <20070827090739.A74CD7C00D4@liste.uludag.org.tr> Author: caglar Date: Mon Aug 27 12:07:39 2007 New Revision: 424 Added: PSP/pspsdk/files/ PSP/pspsdk/files/pspsdk.patch Modified: PSP/pspsdk/pspec.xml Log: bump Modified: PSP/pspsdk/pspec.xml ================================================================= --- PSP/pspsdk/pspec.xml (original) +++ PSP/pspsdk/pspec.xml Mon Aug 27 12:07:39 2007 @@ -20,7 +20,11 @@ newlib-psp doxygen - + + + pspsdk.patch + + pspsdk @@ -38,6 +42,13 @@ + + 2007-08-27 + 2302 + Bump. + S.Çağlar Onur + caglar at pardus.org.tr + 2007-05-21 2228 From projeler-commits at pardus.org.tr Tue Aug 28 14:28:01 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Tue, 28 Aug 2007 14:28:01 +0300 (EEST) Subject: [Projeler-commits] r425 - zangetsu/templates/comments Message-ID: <20070828112801.B65077C0114@liste.uludag.org.tr> Author: bahadir.kandemir Date: Tue Aug 28 14:28:01 2007 New Revision: 425 Modified: zangetsu/templates/comments/freeform.html Log: Show remaining chars in comment form. Modified: zangetsu/templates/comments/freeform.html ================================================================= --- zangetsu/templates/comments/freeform.html (original) +++ zangetsu/templates/comments/freeform.html Tue Aug 28 14:28:01 2007 @@ -6,7 +6,29 @@ {% trans "Comment:" %} - + + +
( {% trans "chars. remaining." %})
+
+ + From projeler-commits at pardus.org.tr Tue Aug 28 19:32:01 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Tue, 28 Aug 2007 19:32:01 +0300 (EEST) Subject: [Projeler-commits] r426 - in zangetsu: static/admin/media/tinymce templates templates/comments Message-ID: <20070828163201.F36CE7C0110@liste.uludag.org.tr> Author: meren Date: Tue Aug 28 19:32:01 2007 New Revision: 426 Added: zangetsu/static/admin/media/tinymce/remaining_chars.js Modified: zangetsu/static/admin/media/tinymce/textareas.js zangetsu/templates/base.html zangetsu/templates/comments/freeform.html Log: show the number of remaining characters below the comment area.. 1337! Modified: zangetsu/static/admin/media/tinymce/textareas.js ================================================================= --- zangetsu/static/admin/media/tinymce/textareas.js (original) +++ zangetsu/static/admin/media/tinymce/textareas.js Tue Aug 28 19:32:01 2007 @@ -1,6 +1,7 @@ tinyMCE.init({ mode : "textareas", theme : "advanced", + textarea_trigger : "tinyMCE_this", theme_advanced_buttons1 : "copy,paste,undo,redo,charmap,search,replace,|,link,unlink,image,|,code", theme_advanced_buttons2 : "formatselect,fontsizeselect,bold,italic,underline,strikethrough,sub,sup,|,justifyleft,justifycenter,justifyright,justifyfull,outdent,indent,|,bullist,numlist,|,forecolor,backcolor,removeformat", theme_advanced_buttons3 : "", @@ -16,4 +17,7 @@ extended_valid_elements : "a[name|href|target|title],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", advimage_update_dimensions_onchange: true, plugins : "advimage,advlink,searchreplace,autosave,fullscreen", + handle_event_callback : "myHandleEvent", + onchange_callback : "myCustomOnChangeHandler", + oninit : "myCustomOnInit" }); Modified: zangetsu/templates/base.html ================================================================= --- zangetsu/templates/base.html (original) +++ zangetsu/templates/base.html Tue Aug 28 19:32:01 2007 @@ -23,6 +23,7 @@ + Modified: zangetsu/templates/comments/freeform.html ================================================================= --- zangetsu/templates/comments/freeform.html (original) +++ zangetsu/templates/comments/freeform.html Tue Aug 28 19:32:01 2007 @@ -1,35 +1,16 @@ {% load i18n %} {% if display_form %} -
+ {% trans "Your name:" %} {% trans "Comment:" %} - + -
( {% trans "chars. remaining." %})
+
{% trans "Remaining number of characters: " %}

- - From projeler-commits at pardus.org.tr Tue Aug 28 22:46:59 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Tue, 28 Aug 2007 22:46:59 +0300 (EEST) Subject: [Projeler-commits] r427 - zangetsu/templates/comments Message-ID: <20070828194659.B261F7C011B@liste.uludag.org.tr> Author: meren Date: Tue Aug 28 22:46:59 2007 New Revision: 427 Modified: zangetsu/templates/comments/freeform.html Log: pfft Modified: zangetsu/templates/comments/freeform.html ================================================================= --- zangetsu/templates/comments/freeform.html (original) +++ zangetsu/templates/comments/freeform.html Tue Aug 28 22:46:59 2007 @@ -8,7 +8,7 @@ {% trans "Comment:" %} -
{% trans "Remaining number of characters: " %}
+
{% trans "Number of remaining characters: " %}

From projeler-commits at pardus.org.tr Wed Aug 29 02:24:43 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Wed, 29 Aug 2007 02:24:43 +0300 (EEST) Subject: [Projeler-commits] r428 - in zangetsu: blog blog/templatetags static templates templates/blog Message-ID: <20070828232443.4AFD87C00B9@liste.uludag.org.tr> Author: meren Date: Wed Aug 29 02:24:43 2007 New Revision: 428 Added: zangetsu/templates/blog/tag_cloud_item.tmpl zangetsu/templates/blog/tag_list_item.tmpl Modified: zangetsu/blog/defaults-dist-default.py zangetsu/blog/templatetags/library.py zangetsu/static/blog.css zangetsu/templates/base.html Log: tag menüsü cloud ya da list olarak seçilebilir olsun... Modified: zangetsu/blog/defaults-dist-default.py ================================================================= --- zangetsu/blog/defaults-dist-default.py (original) +++ zangetsu/blog/defaults-dist-default.py Wed Aug 29 02:24:43 2007 @@ -35,3 +35,6 @@ # Allowed tags and attributes for HTML formatted comments: VALID_TAGS = "em p i hr span font strong b u a h1 h2 h3 pre br img" VALID_ATTRS = "href src class width size noshade face size color style align title hspace vspace" + +#Blog tag menu format: "list" or "cloud" +TAG_MENU = "list" Modified: zangetsu/blog/templatetags/library.py ================================================================= --- zangetsu/blog/templatetags/library.py (original) +++ zangetsu/blog/templatetags/library.py Wed Aug 29 02:24:43 2007 @@ -18,31 +18,46 @@ class TemplateSyntaxError(Exception): pass -class TagCloudObject(Node): +class TagMenuObject(Node): def render(self, context): - tags = {} - tag_objects = Tag.objects.all() - for tag in tag_objects: + tag_menu, tags= "", {} + number_of_levels = 9 + for tag in Tag.objects.all(): tags[tag.title] = len(tag.entry_set.all()) - def sort_func(x, y): - return cmp(x[1], y[1]) + def List(): + tmpl = get_template("blog/tag_list_item.tmpl") + tag_dict = tags.items() + return (tmpl, tag_dict, 1) + + def Cloud(): + items = tags.items() + if len(items) == 0: + return (None, {}, None) + items.sort(lambda x, y: cmp(x[1], y[1])) + items.reverse() + top = items[0][1] or 1 + tmpl = get_template("blog/tag_cloud_item.tmpl") + tag_dict = [items[i] for i in range(len(items) - 1, 0, -1) if i % 2] + [items[i] for i in range(0, len(items)) if not i % 2] + return (tmpl, tag_dict, top) - items = tags.items() - items.sort(sort_func) - items.reverse() - top = items[0][1] - tag_cloud = "" - tmpl = get_template("blog/tag_cloud_item.tmpl") - for item in [items[i] for i in range(len(items), 0, -1) if i % 2] + [items[i] for i in range(0, len(items)) if not i % 2]: - values = {"tag_title": item[0], - "entry_count": item[1], - "cloud_level": str(item[1]*9/top + 1), - "tag_link": "%s/blog/tag/%s/" % (WEB_URL, item[0])} - tag_cloud += tmpl.render(Context(values)) - context["tag_cloud"] = tag_cloud - return "" + tag_menu_handlers = {'list': List, 'cloud': Cloud, 'default': List} + + if defaults.__dict__.has_key("TAG_MENU") and tag_menu_handlers.has_key(defaults.TAG_MENU): + tmpl, tag_dict, top = tag_menu_handlers.get(defaults.TAG_MENU)() + else: + tmpl, tag_dict, top = tag_menu_handlers.get("default")() + for item in tag_dict: + tag_title, entry_count = item + values = {"tag_title": tag_title, + "entry_count": entry_count, + "tag_level": str(entry_count * number_of_levels / top + 1), + "blog_url": "%s/blog" % WEB_URL} + tag_menu += tmpl.render(Context(values)) + + context["tag_menu"] = tag_menu + return "" class BlogNameObject(Node): def render(self, context): @@ -72,16 +87,11 @@ context["blog_months"] = Entry.objects.filter(pubdate__lte=Now()).dates("pubdate", "month", "DESC") return "" -class TagMenuObject(Node): - def render(self, context): - context["blog_tags"] = Tag.objects.all() - return "" - def build_blog_name(parser, token): return BlogNameObject() -def build_tag_cloud(parser, token): - return TagCloudObject() +def build_tag_menu(parser, token): + return TagMenuObject() def build_link_list(parser, token): return LinkMenuObject() @@ -89,11 +99,7 @@ def build_month_list(parser, token): return MonthMenuObject() -def build_tag_list(parser, token): - return TagMenuObject() - register.tag("build_blog_name", build_blog_name) -register.tag("build_tag_cloud", build_tag_cloud) +register.tag("build_tag_menu", build_tag_menu) register.tag("build_link_list", build_link_list) register.tag("build_month_list", build_month_list) -register.tag("build_tag_list", build_tag_list) Modified: zangetsu/static/blog.css ================================================================= --- zangetsu/static/blog.css (original) +++ zangetsu/static/blog.css Wed Aug 29 02:24:43 2007 @@ -155,6 +155,20 @@ padding: 15px 0px 10px 40px; } +.tag_cloud_link {text-decoration: none;} +.tag_cloud_link:visited {text-decoration: none;} +.tag_cloud_link:hover {border-bottom: 1px dashed; text-decoration: none;} +.cloud_level_1 {font-size: 10pt;color: #99AA99;} +.cloud_level_2 {font-size: 12pt;color: #88AA88;} +.cloud_level_3 {font-size: 14pt;color: #77AA77;} +.cloud_level_4 {font-size: 16pt;color: #66AA66;} +.cloud_level_5 {font-size: 17pt;color: #55AA55;} +.cloud_level_6 {font-size: 18pt;color: #44AA44;} +.cloud_level_7 {font-size: 19pt;color: #33AA33;} +.cloud_level_8 {font-size: 20pt;color: #22AA22;} +.cloud_level_9 {font-size: 21pt;color: #11AA11;} +.cloud_level_10 {font-size: 22pt;color: #00AA00;} + .paginator-bottom { display: table; width: 60%; Modified: zangetsu/templates/base.html ================================================================= --- zangetsu/templates/base.html (original) +++ zangetsu/templates/base.html Wed Aug 29 02:24:43 2007 @@ -63,11 +63,8 @@

{% trans "Tags" %}
- {% build_tag_list %} - {% for tag in blog_tags %} - rss - {{ tag.title }} ({{ tag.entry_set.count }})
- {% endfor %} + {% build_tag_menu %} + {{ tag_menu }}

{% trans "Links" %}
- #{{ forloop.counter }}   {{ comment.person_name }} {%trans "commented"%} + #{{ forloop.counter }}   {{ comment.person_name|striptags|escape }} {%trans "commented"%} {{ comment.submit_date|date:"d F y, l" }} @ {{ comment.submit_date|date:"H:i" }}
{{ comment.comment|striptags|escape|urlizetrunc:40|linebreaks }} From projeler-commits at pardus.org.tr Fri Aug 24 23:33:38 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Fri, 24 Aug 2007 23:33:38 +0300 (EEST) Subject: [Projeler-commits] r417 - zangetsu/templates/blog Message-ID: <20070824203338.4D3BF7C0066@liste.uludag.org.tr> Author: meren Date: Fri Aug 24 23:33:38 2007 New Revision: 417 Modified: zangetsu/templates/blog/recent_comments.html Log: aynı şekilde.. Modified: zangetsu/templates/blog/recent_comments.html ================================================================= --- zangetsu/templates/blog/recent_comments.html (original) +++ zangetsu/templates/blog/recent_comments.html Fri Aug 24 23:33:38 2007 @@ -11,7 +11,7 @@ {% if comment.approved %} {% if comment.is_public %}
- {{ comment.person_name }} - {{comment.get_content_object.title}} {%trans "commented"%} + {{ comment.person_name|striptags|escape }} - {{comment.get_content_object.title}} {%trans "commented"%} {{ comment.submit_date|date:"d F y, l" }} @ {{ comment.submit_date|date:"H:i" }}
{{ comment.comment|striptags|escape|urlizetrunc:40|linebreaks }} From projeler-commits at pardus.org.tr Sat Aug 25 15:47:48 2007 From: projeler-commits at pardus.org.tr (projeler-commits at pardus.org.tr) Date: Sat, 25 Aug 2007 15:47:48 +0300 (EEST) Subject: [Projeler-commits] r418 - in zangetsu: blog/templatetags templates/blog Message-ID: <20070825124748.5C1587C00D8@liste.uludag.org.tr> Author: bahadir.kandemir Date: Sat Aug 25 15:47:48 2007 New Revision: 418 Added: zangetsu/blog/templatetags/BeautifulSoup.py zangetsu/blog/templatetags/sanitize_html.py Modified: zangetsu/templates/blog/entry_detail.html zangetsu/templates/blog/recent_comments.html Log: Strip unwanted tags and attributes from comments. Sanitizer passes all tests on http://ha.ckers.org/xss.html BTW, error correction in HTML browsers suck. Modified: zangetsu/templates/blog/entry_detail.html ================================================================= --- zangetsu/templates/blog/entry_detail.html (original) +++ zangetsu/templates/blog/entry_detail.html Sat Aug 25 15:47:48 2007 @@ -1,6 +1,7 @@ {% extends "base.html" %} {% load comments %} {% load library %} +{% load sanitize_html %} {% load i18n %} {% block title %} - {{ object.title }}{% endblock %} @@ -30,7 +31,7 @@ #{{ forloop.counter }}   {{ comment.person_name|striptags|escape }} {%trans "commented"%} {{ comment.submit_date|date:"d F y, l" }} @ {{ comment.submit_date|date:"H:i" }}
- {{ comment.comment|striptags|escape|urlizetrunc:40|linebreaks }} + {{ comment.comment|sanitize }}
{%endif%} {%endif%} Modified: zangetsu/templates/blog/recent_comments.html ================================================================= --- zangetsu/templates/blog/recent_comments.html (original) +++ zangetsu/templates/blog/recent_comments.html Sat Aug 25 15:47:48 2007 @@ -1,4 +1,5 @@ {% load library %} +{% load sanitize_html %} {% load i18n %} {% extends "base.html" %} {% block content %} @@ -14,7 +15,7 @@ {{ comment.person_name|striptags|escape }} - {{comment.get_content_object.title}} {%trans "commented"%} {{ comment.submit_date|date:"d F y, l" }} @ {{ comment.submit_date|date:"H:i" }}
- {{ comment.comment|striptags|escape|urlizetrunc:40|linebreaks }} + {{ comment.comment|sanitize }}