PageRenderTime 60ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/scanner/Models/typo3.php

https://bitbucket.org/theguly/thaps
PHP | 182 lines | 143 code | 37 blank | 2 comment | 0 complexity | a28ca676266b2a70538908d64efb9880 MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause
  1. <?php
  2. class TypoDB {
  3. public function exec_INSERTquery($table, $fields_values) {
  4. // Potential vulnerability if the $field_values array contains tainted keys
  5. mysql_query($table);
  6. }
  7. public function exec_INSERTmultipleRows($table, array $fields, array $rows, $no_quote_fields) {
  8. // Potential vulnerability if the $field_values array contains tainted keys
  9. mysql_query($table);
  10. mysql_query($fields);
  11. }
  12. public function exec_DELETEquery($table, $where) {
  13. mysql_query($table);
  14. mysql_query($where);
  15. }
  16. public function exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit) {
  17. mysql_query($select_fields);
  18. mysql_query($from_table);
  19. mysql_query($where_clause);
  20. mysql_query($groupBy);
  21. mysql_query($orderBy);
  22. mysql_query($limit);
  23. }
  24. public function exec_SELECT_mm_query($select, $local_table, $mm_table, $foreign_table, $whereClause, $groupBy, $orderBy, $limit) {
  25. mysql_query($select);
  26. mysql_query($local_table);
  27. mysql_query($mm_table);
  28. mysql_query($foreign_table);
  29. mysql_query($whereClause);
  30. mysql_query($groupBy);
  31. mysql_query($orderBy);
  32. mysql_query($limit);
  33. }
  34. public function exec_SELECT_queryArray($queryParts) {
  35. mysql_query($queryParts['SELECT']);
  36. mysql_query($queryParts['FROM']);
  37. mysql_query($queryParts['WHERE']);
  38. mysql_query($queryParts['GROUPBY']);
  39. mysql_query($queryParts['ORDERBY']);
  40. mysql_query($queryParts['LIMIT']);
  41. }
  42. public function exec_SELECTgetSingleRow($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $numIndex) {
  43. mysql_query($select_fields);
  44. mysql_query($from_table);
  45. mysql_query($were_clause);
  46. mysql_query($groupBy);
  47. mysql_query($orderBy);
  48. mysql_query($numIndex);
  49. }
  50. public function exec_SELECTgetRows($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit, $uidIndexField) {
  51. mysql_query($select_fields);
  52. mysql_query($from_table);
  53. mysql_query($where_clause);
  54. mysql_query($groupBy);
  55. mysql_query($orderBy);
  56. mysql_query($limit);
  57. }
  58. public function exec_SELECTcountRows($field, $table, $where = '') {
  59. mysql_query($field);
  60. mysql_query($table);
  61. mysql_query($where);
  62. }
  63. public function exec_TRUNCATEquery($table) {
  64. mysql_query($table);
  65. }
  66. public function INSERTquery($table, $fields_values) {
  67. return $table;
  68. }
  69. public function INSERTmultipleRows($table, array $fields, array $rows, $no_quote_fields) {
  70. return $table ." ". $fields;
  71. }
  72. public function UPDATEquery($table, $where, $fields_values) {
  73. return $table ." ". $where;
  74. }
  75. public function DELETEquery($table, $where) {
  76. return $table ." ". $where;
  77. }
  78. public function SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit) {
  79. return $select_fields ." ". $from_table ." ". $where_caluse ." ". $groupBy ." ". $orderBy ." ". $limit;
  80. }
  81. public function listQuery($field, $value, $table) {
  82. return $field;
  83. }
  84. public function searchQuery($searchWords, $fields, $table) {
  85. return $fields ." ". $table;
  86. }
  87. public function quoteStr($str, $table) {
  88. return mysql_real_escape_string($str);
  89. }
  90. public function fullQuoteStr($str, $table) {
  91. return '\''. mysql_real_escape_string($str) .'\'';
  92. }
  93. public function fullQuoteArray($arr, $table) {
  94. return mysql_real_escape_string($arr);
  95. }
  96. public function escapeStrForLike($str) {
  97. return "";
  98. }
  99. public function cleanIntArray($arr) {
  100. return "";
  101. }
  102. public function cleanIntList($list) {
  103. return "";
  104. }
  105. public function stripOrderBy($str) {
  106. return $str;
  107. }
  108. public function stripGroupBy($str) {
  109. return $str;
  110. }
  111. public function splitGroupOrderLimit($str) {
  112. return $str;
  113. }
  114. public function sql_query($query) {
  115. mysql_query($query);
  116. }
  117. public function admin_get_fields($tableName) {
  118. mysql_query($tableName);
  119. }
  120. public function admin_get_keys($tableName) {
  121. mysql_query($tableName);
  122. }
  123. public function admin_query($query) {
  124. mysql_query($query);
  125. }
  126. }
  127. class t3lib_div {
  128. public static _GP($str) {
  129. return $_GET[$str];
  130. }
  131. public static _GPmerged($str) {
  132. return $_GET[$str];
  133. }
  134. public static _GET($str) {
  135. return $_GET[$str];
  136. }
  137. public static _POST($str) {
  138. return $_POST[$str];
  139. }
  140. public static _GETset($str) {
  141. $_GET[$str] = "";
  142. }
  143. }
  144. $GLOBALS = array();
  145. $GLOBALS['TYPO3_DB'] = new TypoDB();