enhance #140 with an even stricter regex expression to minimize possibility of conflict between actual data and encoding options. Fixes #139

This commit is contained in:
Nikos Ftylitakis 2019-09-29 00:24:54 +03:00
parent 993ef49fe6
commit 8c296ec32e

View File

@ -28,7 +28,7 @@ QImage QZXingImageProvider::requestImage(const QString &id, QSize *size, const Q
QZXing::EncoderFormat format = QZXing::EncoderFormat_QR_CODE; QZXing::EncoderFormat format = QZXing::EncoderFormat_QR_CODE;
QZXing::EncodeErrorCorrectionLevel correctionLevel = QZXing::EncodeErrorCorrectionLevel_L; QZXing::EncodeErrorCorrectionLevel correctionLevel = QZXing::EncodeErrorCorrectionLevel_L;
int customSettingsIndex = id.lastIndexOf(QRegExp("\?[cf]")); int customSettingsIndex = id.lastIndexOf(QRegExp("\?(corretionLevel|format)="));
if(customSettingsIndex >= 0) if(customSettingsIndex >= 0)
{ {
int startOfDataIndex = slashIndex + 1; int startOfDataIndex = slashIndex + 1;