From: Greg Beaver Date: Mon, 7 Jan 2008 17:18:41 +0000 (+0000) Subject: fix extension detection for aliases with no extension X-Git-Tag: RELEASE_2_0_0a1~1001 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3dca799fbb36f0e4143eb1d36e72c80326a3d376;p=php fix extension detection for aliases with no extension --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index aa566b3942..046a5be406 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1998,10 +1998,10 @@ int phar_detect_phar_fname_ext(const char *filename, int check_length, char **ex } else if (pos_t) { *ext_str = pos_t; *ext_len = 9; - } else if ((pos_p = strstr(filename, ".phar")) != NULL) { + } else if ((pos_p = strstr(filename, ".phar")) != NULL && pos_p[4] != '\0') { *ext_str = pos_p; *ext_len = 5; - } else if ((pos_p = strstr(filename, ".php")) != NULL) { + } else if ((pos_p = strstr(filename, ".php")) != NULL && pos_p[4] != '\0') { *ext_str = pos_p; *ext_len = 4; } else {