Diff
Not logged in

Differences From:

File src/info.c part of check-in [0be54823ba] - Add defenses against cross-site request forgery attacks. by drh on 2008-10-18 12:55:44. [view]

To:

File src/info.c part of check-in [c8a78004ce] - Improvements in the display of ticket history. by drh on 2008-10-20 16:05:03. [view]

@@ -834,20 +834,8 @@
   style_footer();
 }
 
 /*
-** Return TRUE if the given BLOB contains a newline character.
-*/
-static int contains_newline(Blob *p){
-  const char *z = blob_str(p);
-  while( *z ){
-    if( *z=='\n' ) return 1;
-    z++;
-  }
-  return 0;
-}
-
-/*
 ** WEBPAGE: tinfo
 ** URL: /tinfo?name=UUID
 **
 ** Show the details of a ticket change control artifact.
@@ -855,12 +843,10 @@
 void tinfo_page(void){
   int rid;
   Blob content;
   char *zDate;
-  int i;
   const char *zUuid;
   char zTktName[20];
-  const char *z;
   Manifest m;
 
   login_check_credentials();
   if( !g.okRdTkt ){ login_needed(); return; }
@@ -895,27 +881,10 @@
   @ </p>
   @
   @ <ol>
   free(zDate);
-  for(i=0; i<m.nField; i++){
-    Blob val;
-    z = m.aField[i].zName;
-    blob_set(&val, m.aField[i].zValue);
-    if( z[0]=='+' ){
-      @ <li><p>Appended to %h(&z[1]):</p><blockquote>
-      wiki_convert(&val, 0, 0);
-      @ </blockquote></li>
-    }else if( blob_size(&val)<=50 && contains_newline(&val) ){
-      @ <li><p>Change %h(z) to:</p><blockquote>
-      wiki_convert(&val, 0, 0);
-      @ </blockquote></li>
-    }else{
-      @ <li><p>Change %h(z) to "%h(blob_str(&val))"</p></li>
-    }
-    blob_reset(&val);
-  }
-  manifest_clear(&m);
-  @ </ol>
+  ticket_output_change_artifact(&m);
+  manifest_clear(&m);
   style_footer();
 }