Bug 836708 - [B2G RIL] Validate the numbers that are passed from SMSManager.send. r=vicamo

--HG--
extra : rebase_source : 05cbb8f610b952338f89939f44039177ac55efcf
This commit is contained in:
Julien Wajsberg 2013-03-08 18:46:15 +01:00
parent b76d808dbf
commit f6d15ab18e

View File

@ -2670,7 +2670,7 @@ RadioInterfaceLayer.prototype = {
let options = this._fragmentText(message, null, strict7BitEncoding);
options.rilMessageType = "sendSMS";
options.number = number;
options.number = PhoneNumberUtils.normalize(number);
options.requestStatusReport = true;
if (options.segmentMaxSeq > 1) {
options.segmentRef16Bit = this.segmentRef16Bit;
@ -2701,7 +2701,14 @@ RadioInterfaceLayer.prototype = {
sms: sms,
requestStatusReport: options.requestStatusReport
});
if (PhoneNumberUtils.isPlainPhoneNumber(options.number)) {
this.worker.postMessage(options);
} else {
debug('Number ' + options.number + ' is not sendable.');
this.handleSmsSendFailed(options);
}
}.bind(this));
},