protected int
file_printf(struct magic_set *ms, const char *fmt, ...)
{
- int rv;
va_list ap;
int len;
char *buf = NULL, *newstr;
if (file_printf(ms, "%s", code_mime) == -1)
rv = -1;
}
+#if PHP_FILEINFO_UNCOMPRESS
done_encoding:
+#endif
free(u8buf);
if (rv)
return rv;
(void)setlocale(LC_CTYPE, "C");
opts |= PCRE_MULTILINE;
- convert_libmagic_pattern(&patt, pat, strlen(pat), opts);
+ convert_libmagic_pattern(&patt, (char*)pat, strlen(pat), opts);
if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) {
zval_ptr_dtor(&patt);
rep_cnt = -1;
/* Need to fetch global match which equals pmatch[0] */
zval *pzval;
HashTable *ht = Z_ARRVAL(subpats);
- if ((pzval = zend_hash_index_find(ht, 0)) != NULL) {
+ if ((pzval = zend_hash_index_find(ht, 0)) != NULL && Z_TYPE_P(pzval) == IS_ARRAY) {
/* If everything goes according to the master plan
tmpcopy now contains two elements:
0 = the match