fn make_safe_param_value(&self, line: &String, quote_ch: char) -> String {
        // we speculatievly expect that in most cases 
        // we don't actually need to entity-encode string
        for i in 0..line.len() {
            if line.chars().nth(i).unwrap() != quote_ch {
                continue;
            }

            // have to restart here
            let mut new_s: String = line.chars().take(i).collect();

            for j in i..line.len() {
                let ch = line.chars().nth(j).unwrap();

                if ch == quote_ch {
                    new_s = new_s + "&#" + &(ch as usize).to_string() + ";";
                } else {
                    new_s = new_s + &ch.to_string();
                }
            }

            return new_s;
        }

        line.clone()
    }
/// Makes parameter value safe to be used in 
/// param - this will check for any conflicting quote chars,
/// but not full entity-encoding
Makes parameter value safe to be used in
param - this will check for any conflicting quote chars,
but not full entity-encoding
Makes parameter value safe to be used in param - this will check for any conflicting quote chars but not full entity - encoding
fn make_safe_param_value(&self, line: &String, quote_ch: char) -> String {
        // we speculatievly expect that in most cases 
        // we don't actually need to entity-encode string
        for i in 0..line.len() {
            if line.chars().nth(i).unwrap() != quote_ch {
                continue;
            }
            // have to restart here
            let mut new_s: String = line.chars().take(i).collect();
            for j in i..line.len() {
                let ch = line.chars().nth(j).unwrap();
                if ch == quote_ch {
                    new_s = new_s + "&#" + &(ch as usize).to_string() + ";";
                } else {
                    new_s = new_s + &ch.to_string();
                }
            }
            return new_s;
        }
        line.clone()
    }
fn make_safe_param_value ( & self , line : & String , quote_ch : char ) -> String { // we speculatievly expect that in most cases  // we don't actually need to entity-encode string for i in 0 .. line . len ( ) { if line . chars ( ) . nth ( i ) . unwrap ( ) != quote_ch { continue ; } // have to restart here let mut new_s : String = line . chars ( ) . take ( i ) . collect ( ) ; for j in i .. line . len ( ) { let ch = line . chars ( ) . nth ( j ) . unwrap ( ) ; if ch == quote_ch { new_s = new_s + " " + & ( ch as usize ) . to_string ( ) + " " ; } else { new_s = new_s + & ch . to_string ( ) ; } } return new_s ; } line . clone ( ) }
Makes parameter value safe to be used in
param - this will check for any conflicting quote chars,
but not full entity-encoding
Makes parameter value safe to be used in param - this will check for any conflicting quote chars but not full entity - encoding
&self
line
&String
quote_ch
char
&self
line
&String
quote_ch
char