Fossil Forum

Use correct parameter in /ci{,_tags}
Login

Use correct parameter in /ci{,_tags}

Use correct parameter in /ci{,_tags}

(1) By anonymous on 2021-10-12 13:42:39 [source]

The /ci and /ci_tag page use g.argv instead of the cgi parameters. This shows either nothing or the corresponding argument from the command line with which the server was started (example, should show: No such object: nonexistent). A fix is below. It simply displays nothing if no name parameter exists. Other pages (like /info) redirect back to home. I can change it to redirect if you prefer it.

Index: src/info.c                                                                                                 
==================================================================                                                
--- src/info.c                                                                                                    
+++ src/info.c        
@@ -493,11 +493,11 @@
   login_check_credentials();      
   if( !g.perm.Read ){ login_needed(g.anon.Read); return; }                                                       
   rid = name_to_rid_www("name");      
   if( rid==0 ){                    
     style_header("Check-in Information Error");
-    @ No such object: %h(g.argv[2])                                                                              
+    @ No such object: %h(PD("name",""))
     style_finish_page();
     return;     
   }                                                                                                              
   zHash = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);                                                 
   style_header("Tags and Properties");
@@ -627,11 +627,11 @@                                                                                             
   style_set_current_feature("vinfo");                                                                            
   zName = P("name");                                                                                             
   rid = name_to_rid_www("name");
   if( rid==0 ){
     style_header("Check-in Information Error");
-    @ No such object: %h(g.argv[2])
+    @ No such object: %h(PD("name",""))  
     style_finish_page();              
     return;
   } 
   zRe = P("regex");
   if( zRe ) re_compile(&pRe, zRe, 0);

(2) By sean (jungleboogie) on 2021-10-12 17:55:27 in reply to 1 [link] [source]