Roxen.git / server / modules / tags / sqltag.pike

version» Context lines:

Roxen.git/server/modules/tags/sqltag.pike:1:   /* -  * $Id: sqltag.pike,v 1.24 1998/07/15 16:04:55 js Exp $ +  * $Id: sqltag.pike,v 1.25 1998/07/21 15:28:09 per Exp $    *    * A module for Roxen Challenger, which gives the tags    * <SQLQUERY> and <SQLOUTPUT>.    *    * Henrik Grubbström 1997-01-12    */    - constant cvs_version="$Id: sqltag.pike,v 1.24 1998/07/15 16:04:55 js Exp $"; + constant cvs_version="$Id: sqltag.pike,v 1.25 1998/07/21 15:28:09 per Exp $";   constant thread_safe=1;   #include <module.h>      /* Compatibility with old versions of the sqltag module. */   // #define SQL_TAG_COMPAT      inherit "module";   inherit "roxenlib";      import Array;
Roxen.git/server/modules/tags/sqltag.pike:133:    sql_connect = 0;    }    if (sql_connect) {    error = catch(con = sql_connect(host));    } else {    host = (lower_case(host) == "localhost")?"":host;    error = catch(con = sql(host, database, user, password));    }    if (error) {    if (!args->quiet) { -  contents = "<h1>Couldn't connect to SQL-server</h1><br>\n" + -  ((master()->describe_backtrace(error)/"\n")*"<br>\n" + "<false>"); +  contents = ("<h3>Couldn't connect to SQL-server</h1><br>\n" + +  html_encode_string(error[0]) + "<false>");    } else {    contents = "<false>";    }    } else if (error = catch(result = con->query(args->query))) {    if (!args->quiet) { -  contents = "<h1>Query \"" + args->query + "\" failed: " + -  con->error() + "</h1>\n" + -  ((master()->describe_backtrace(error)/"\n")*"<br>\n" + "<false>"); +  contents = ("<h3>Query \"" + html_encode_string(args->query) +  + "\" failed: " + html_encode_string(con->error()) +  + "</h1>\n<false>");    } else {    contents = "<false>";    }    } else if (result && sizeof(result))    {    contents = do_output_tag( args, result, contents, request_id )    + "<true>";    } else {    contents = "<false>";    }
Roxen.git/server/modules/tags/sqltag.pike:210:    sql_connect = 0;    }    if (sql_connect) {    error = catch(con = sql_connect(host));    } else {    host = (lower_case(host) == "localhost")?"":host;    error = catch(con = sql(host, database, user, password));    }    if (error) {    if (!args->quiet) { -  return("<h1>Couldn't connect to SQL-server</h1><br>\n" + -  ((master()->describe_backtrace(error)/"\n")*"<br>\n" + -  "<false>")); +  return("<h3>Couldn't connect to SQL-server</h1><br>\n" + +  html_encode_string(error[0])+"<false>");    } else {    return("<false>");    }    } else if (error = catch(res = con->query(args->query))) {    if (!args->quiet) { -  return("<h1>Query \"" + args->query + "\" failed: " + -  con->error() + "</h1>\n" + -  ((master()->describe_backtrace(error)/"\n")*"<br>\n" + -  "<false>")); +  return("<h3>Query \"" + html_encode_string(args->query)+"\" failed: " +  + html_encode_string(con->error()) + "</h1>\n<false>");    } else {    return("<false>");    }    }    return(res?"<true>":"<false>");    } else {    return("<!-- No query! --><false>");    }   }   
Roxen.git/server/modules/tags/sqltag.pike:291:    sql_connect = 0;    }    if (sql_connect) {    error = catch(con = sql_connect(host));    } else {    host = (lower_case(host) == "localhost")?"":host;    error = catch(con = sql(host, database, user, password));    }    if (error) {    if (!args->quiet) { -  return("<h1>Couldn't connect to SQL-server</h1><br>\n" + -  ((master()->describe_backtrace(error)/"\n")*"<br>\n" + -  "<false>")); +  return("<h3>Couldn't connect to SQL-server</h1><br>\n" + +  html_encode_string(error[0])+"<false>");    } else {    return("<false>");    }    } else if (error = catch(result = con->big_query(args->query))) {    if (!args->quiet) { -  return("<h1>Query \"" + args->query + "\" failed: " + -  con->error() + "</h1>\n" + -  ((master()->describe_backtrace(error)/"\n")*"<br>\n" + -  "<false>")); +  return ("<h3>Query \"" + html_encode_string(args->query) + +  "\" failed: " + html_encode_string(con->error()) + "</h1>\n" + +  "<false>");    } else {    return("<false>");    }    }       if (result) {    string nullvalue="";    array(mixed) row;       if (args->nullvalue) {