mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-13 06:03:37 +02:00
2020-03-18 Fred Gleason <fredg@paravelsystems.com>
* Added a 'FEED_IMAGES' table to the database. * Added 'feed_image_test' in 'tests/'. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Escape non-valid characters in a string.
|
||||
//
|
||||
// (C) Copyright 2002-2005,2016-2017 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@@ -113,3 +113,21 @@ QString RDEscapeShellString(QString str)
|
||||
{
|
||||
return "\""+str.replace("$","\\$")+"\"";
|
||||
}
|
||||
|
||||
|
||||
QString RDEscapeBlob(const QByteArray &data)
|
||||
{
|
||||
return RDEscapeBlob(data.constData(),data.length());
|
||||
}
|
||||
|
||||
|
||||
QString RDEscapeBlob(const char *data,size_t len)
|
||||
{
|
||||
QString ret="x'";
|
||||
|
||||
for(unsigned i=0;i<len;i++) {
|
||||
ret+=QString().sprintf("%02x",0xff&data[i]);
|
||||
}
|
||||
|
||||
return ret+"'";
|
||||
}
|
||||
|
Reference in New Issue
Block a user