File: testsupport.php

package info (click to toggle)
modsecurity 3.0.14-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 88,920 kB
  • sloc: ansic: 174,512; sh: 43,569; cpp: 26,214; python: 15,734; makefile: 3,864; yacc: 2,947; lex: 1,359; perl: 1,243; php: 42; tcl: 4
file content (35 lines) | stat: -rw-r--r-- 876 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
function print_token($tok) {
    $tt = libinjection_sqli_token_type_get($tok);
    $out = '';
    $out .= $tt;
    $out .= ' ';
    if ($tt == 's') {
        $out .= print_token_string($tok);
    } else if ($tt == 'v') {
        $vc = libinjection_sqli_token_count_get($tok);
        if ($vc == 1) {
            $out .= '@';
        } else if ($vc == 2) {
            $out .= '@@';
        }
        $out .= print_token_string($tok);
    } else {
        $out .= libinjection_sqli_token_val_get($tok);
    }
    return trim($out);
}

function print_token_string($tok) {
   $out = '';
   $quote = libinjection_sqli_token_str_open_get($tok);
   if ($quote != "\0") {
       $out .= $quote;
   }
   $out .= libinjection_sqli_token_val_get($tok);
   $quote = libinjection_sqli_token_str_close_get($tok);
   if ($quote != "\0") {
       $out .= $quote;
   }
   return $out;
}