Open Carsak opened 1 year ago
I was wrong
I cant figure out, why I got error if regexp is correct. I checked this on regexOnline it is correct:
But in php i got error:
the text is same
could somebody explain why this regexp dont work? https://onlinephp.io/c/221e2
Is the spaces in the expression. Remove spaces!
if (!preg_match('/^WWW-Authenti*cate*:.n*once="(.*)"/miU',$x, $m)) {
Às 09:37 de 2023/01/23, Alma Z escreveu:
could somebody explain why this regexp dont work? https://onlinephp.io/c/221e2
— Reply to this email directly, view it on GitHub https://github.com/level7systems/php-sip/issues/12#issuecomment-1400043548, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZETTMNJ67S377DWCAWR4TWTZGMHANCNFSM6AAAAAAUDR4CV4. You are receiving this because you are subscribed to this thread.Message ID: @.***>
OMG. yes.
So, correct pattern should be
/^WWW-Authenticate:.*nonce="(.*)"/imU
not
/^WWW-Authenticate: .* nonce="(.*)"/imU
I cant auth to sip server, cause class PhpSip cant parse "nonce"
in code we have line line
if (!preg_match('/^WWW-Authenticate: .* nonce="(.*)"/imU',$this->rx_msg, $m))
But I got this string in rx_msg
So the regexp pattern must be
/.*WWW-Authenticate: .* nonce="(.*)"/imU
not/^WWW-Authenticate: .* nonce="(.*)"/imU