viewgit/index.php:465 Only variables should be passed by reference [2048]

viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]

  1.  
  2. using System;
  3. using System.Data.SQLite;
  4. using System.Collections;
  5.  
  6. namespace Dizzy
  7. {
  8.  
  9.  
  10. public class FileList
  11. {
  12.  
  13. SQLiteConnection connection;
  14.  
  15. public FileList() {
  16. string connectionString = "Data Source=" + GlobalConfig.ListFileName () + ";Version=3";
  17. this.connection = new SQLiteConnection(connectionString);
  18. }
  19.  
  20. public ArrayList Search(string keyword, string type, string user) {
  21.  
  22. /* Facciamo qualche check per evitare utenti che inseriscono
  23. * cose a caso */
  24. keyword.Replace("%", "\\%");
  25. keyword.Replace(";", "\\;");
  26.  
  27. /* keyword è presumibilmente nella forma di più keyword separate da
  28. * spazi, e quindi dobbiamo sottoporla ad un "preprocessing" prima
  29. * di darla in pasto ad una query sql. Per ora assumiamo che l'utente
  30. * voglia l'unione dei risultati con le singole query. */
  31. string [] keys = keyword.Split(' ');
  32.  
  33. this.connection.Open ();
  34. ArrayList matches = new ArrayList ();
  35.  
  36. // Eseguiamo la query
  37. SQLiteCommand sqlCmd = this.connection.CreateCommand ();
  38. string query = "SELECT * from files WHERE";
  39. foreach(string k in keys)
  40. {
  41. if (query.EndsWith("'"))
  42. query += " OR name LIKE '%" + k + "%'";
  43. else
  44. query += " name LIKE '%" + k + "%'";
  45. }
  46.  
  47. /* Concludiamo gloriosamente la query */
  48. query += ";";
  49. sqlCmd.CommandText = query;
  50. Log.Debug ("SQL", "Executing query " + sqlCmd.CommandText);
  51.  
  52. SQLiteDataReader reader = sqlCmd.ExecuteReader ();
  53.  
  54. File tmp;
  55. while(reader.Read())
  56. {
  57. tmp = new File(reader.GetString(0), // Path
  58. reader.GetString(2), // User
  59. reader.GetString(1), // Name
  60. reader.GetInt32(3)); // Size
  61.  
  62. if ( (type == "Qualsiasi" || tmp.type.Name() == type) &&
  63. (user == "" || user == tmp.user) )
  64. {
  65. matches.Add (tmp);
  66. }
  67. }
  68.  
  69. this.connection.Close ();
  70. return matches;
  71. }
  72. }
  73. }