Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* }}} */
- /* {{{ proto String SQLite3::escapeString(String value)
- Returns a string that has been properly escaped. */
- PHP_METHOD(sqlite3, escapeString)
- {
- char *sql, *ret;
- int sql_len;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &sql, &sql_len)) {
- return;
- }
- if (sql_len) {
- ret = sqlite3_mprintf("%q", sql);
- if (ret) {
- RETVAL_STRING(ret, 1);
- sqlite3_free(ret);
- }
- } else {
- RETURN_EMPTY_STRING();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment