Mercurial > geeqie.yaz
comparison src/image-overlay.c @ 483:c9e3baeda1b1
Correctly escape data before using pango_layout_set_markup().
Exif data may contain characters like & or < >.
author | zas_ |
---|---|
date | Tue, 22 Apr 2008 09:40:05 +0000 |
parents | 75b7154e6435 |
children | e5023cced4e5 |
comparison
equal
deleted
inserted
replaced
482:75b7154e6435 | 483:c9e3baeda1b1 |
---|---|
202 { | 202 { |
203 gchar *new_data = g_strdup_printf("%-*.*s...", limit, limit, data); | 203 gchar *new_data = g_strdup_printf("%-*.*s...", limit, limit, data); |
204 g_free(data); | 204 g_free(data); |
205 data = new_data; | 205 data = new_data; |
206 } | 206 } |
207 | 207 if (data) |
208 { | |
209 /* Since we use pango markup to display, we need to escape here */ | |
210 gchar *escaped = g_markup_escape_text(data, -1); | |
211 g_free(data); | |
212 data = escaped; | |
213 } | |
208 g_string_erase(new, pos, end-start+1); | 214 g_string_erase(new, pos, end-start+1); |
209 if (data) | 215 if (data) |
210 g_string_insert(new, pos, data); | 216 g_string_insert(new, pos, data); |
211 if (pos-prev == 2 && new->str[pos-1] == imp) | 217 if (pos-prev == 2 && new->str[pos-1] == imp) |
212 { | 218 { |
377 for (mark = 0; mark < FILEDATA_MARKS_SIZE; mark++) | 383 for (mark = 0; mark < FILEDATA_MARKS_SIZE; mark++) |
378 { | 384 { |
379 active_marks += fd->marks[mark]; | 385 active_marks += fd->marks[mark]; |
380 } | 386 } |
381 | 387 |
382 | |
383 if (active_marks > 0) | 388 if (active_marks > 0) |
384 { | 389 { |
385 GString *buf = g_string_sized_new(FILEDATA_MARKS_SIZE * 2); | 390 GString *buf = g_string_sized_new(FILEDATA_MARKS_SIZE * 2); |
386 | 391 |
387 for (mark = 0; mark < FILEDATA_MARKS_SIZE; mark++) | 392 for (mark = 0; mark < FILEDATA_MARKS_SIZE; mark++) |
398 text = text2; | 403 text = text2; |
399 } | 404 } |
400 | 405 |
401 if (with_hist) | 406 if (with_hist) |
402 { | 407 { |
408 gchar *escaped_histogram_label = g_markup_escape_text(histogram_label(imd->histogram), -1); | |
403 if (*text) | 409 if (*text) |
404 text2 = g_strdup_printf("%s\n%s", text, histogram_label(imd->histogram)); | 410 text2 = g_strdup_printf("%s\n%s", text, escaped_histogram_label); |
405 else | 411 else |
406 text2 = g_strdup(histogram_label(imd->histogram)); | 412 text2 = g_strdup(escaped_histogram_label); |
413 g_free(escaped_histogram_label); | |
407 g_free(text); | 414 g_free(text); |
408 text = text2; | 415 text = text2; |
409 } | 416 } |
410 } | 417 } |
411 } | 418 } |