Fossil SCM

Fix the captcha-audio page so that it works even without a seed value.

drh 2023-05-27 15:02 trunk
Commit a1178d57340baa9620731e92de175b234e8e6fd7773485b264697a417443f85f
1 file changed +1 -1
+1 -1
--- src/captcha.c
+++ src/captcha.c
@@ -685,11 +685,11 @@
685685
**
686686
** Return a WAV file that pronounces the digits of the captcha that
687687
** is determined by the seed given in the name= query parameter.
688688
*/
689689
void captcha_wav_page(void){
690
- const char *zSeed = P("name");
690
+ const char *zSeed = PD("name","0");
691691
const char *zDecode = captcha_decode((unsigned int)atoi(zSeed));
692692
Blob audio;
693693
captcha_wav(zDecode, &audio);
694694
cgi_set_content_type("audio/wav");
695695
cgi_set_content(&audio);
696696
--- src/captcha.c
+++ src/captcha.c
@@ -685,11 +685,11 @@
685 **
686 ** Return a WAV file that pronounces the digits of the captcha that
687 ** is determined by the seed given in the name= query parameter.
688 */
689 void captcha_wav_page(void){
690 const char *zSeed = P("name");
691 const char *zDecode = captcha_decode((unsigned int)atoi(zSeed));
692 Blob audio;
693 captcha_wav(zDecode, &audio);
694 cgi_set_content_type("audio/wav");
695 cgi_set_content(&audio);
696
--- src/captcha.c
+++ src/captcha.c
@@ -685,11 +685,11 @@
685 **
686 ** Return a WAV file that pronounces the digits of the captcha that
687 ** is determined by the seed given in the name= query parameter.
688 */
689 void captcha_wav_page(void){
690 const char *zSeed = PD("name","0");
691 const char *zDecode = captcha_decode((unsigned int)atoi(zSeed));
692 Blob audio;
693 captcha_wav(zDecode, &audio);
694 cgi_set_content_type("audio/wav");
695 cgi_set_content(&audio);
696

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button