@@ -409,7 +409,7 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
409
409
php_stream_statbuf ssbuf ;
410
410
char * resolved_path ;
411
411
const char * path_to_open = NULL ;
412
- bool isescaped = false;
412
+ bool is_escaped = false;
413
413
414
414
if (strstr (filename , "%00" )) {
415
415
php_error_docref (NULL , E_WARNING , "URI must not contain percent-encoded NUL bytes" );
@@ -420,7 +420,7 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
420
420
if (uri && (uri -> scheme == NULL ||
421
421
(xmlStrncmp (BAD_CAST uri -> scheme , BAD_CAST "file" , 4 ) == 0 ))) {
422
422
resolved_path = xmlURIUnescapeString (filename , 0 , NULL );
423
- isescaped = 1 ;
423
+ is_escaped = true ;
424
424
#if LIBXML_VERSION >= 20902 && LIBXML_VERSION < 21300 && defined(PHP_WIN32 )
425
425
/* Libxml 2.9.2 prefixes local paths with file:/ instead of file://,
426
426
thus the php stream wrapper will fail on a valid case. For this
@@ -458,7 +458,7 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
458
458
php_stream_wrapper * wrapper = php_stream_locate_url_wrapper (resolved_path , & path_to_open , 0 );
459
459
if (wrapper && read_only && wrapper -> wops -> url_stat ) {
460
460
if (wrapper -> wops -> url_stat (wrapper , path_to_open , PHP_STREAM_URL_STAT_QUIET , & ssbuf , NULL ) == -1 ) {
461
- if (isescaped ) {
461
+ if (is_escaped ) {
462
462
xmlFree (resolved_path );
463
463
}
464
464
return NULL ;
@@ -472,7 +472,7 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
472
472
/* Prevent from closing this by fclose() */
473
473
ret_val -> flags |= PHP_STREAM_FLAG_NO_FCLOSE ;
474
474
}
475
- if (isescaped ) {
475
+ if (is_escaped ) {
476
476
xmlFree (resolved_path );
477
477
}
478
478
return ret_val ;
@@ -513,13 +513,14 @@ php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
513
513
return NULL ;
514
514
}
515
515
516
- if (URI == NULL )
517
- return (NULL );
516
+ if (URI == NULL ) {
517
+ return NULL ;
518
+ }
518
519
519
520
context = php_libxml_streams_IO_open_read_wrapper (URI );
520
521
521
522
if (context == NULL ) {
522
- return ( NULL ) ;
523
+ return NULL ;
523
524
}
524
525
525
526
/* Check if there's been an external transport protocol with an encoding information */
@@ -544,7 +545,7 @@ php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
544
545
} else
545
546
php_libxml_streams_IO_close (context );
546
547
547
- return ( ret ) ;
548
+ return ret ;
548
549
}
549
550
550
551
static xmlOutputBufferPtr
@@ -559,8 +560,9 @@ php_libxml_output_buffer_create_filename(const char *URI,
559
560
void * context = NULL ;
560
561
char * unescaped = NULL ;
561
562
562
- if (URI == NULL )
563
+ if (URI == NULL ) {
563
564
goto err ;
565
+ }
564
566
565
567
if (strstr (URI , "%00" )) {
566
568
php_error_docref (NULL , E_WARNING , "URI must not contain percent-encoded NUL bytes" );
@@ -569,8 +571,9 @@ php_libxml_output_buffer_create_filename(const char *URI,
569
571
570
572
puri = xmlParseURI (URI );
571
573
if (puri != NULL ) {
572
- if (puri -> scheme != NULL )
574
+ if (puri -> scheme != NULL ) {
573
575
unescaped = xmlURIUnescapeString (URI , 0 , NULL );
576
+ }
574
577
xmlFreeURI (puri );
575
578
}
576
579
@@ -596,7 +599,7 @@ php_libxml_output_buffer_create_filename(const char *URI,
596
599
ret -> closecallback = php_libxml_streams_IO_close ;
597
600
}
598
601
599
- return ( ret ) ;
602
+ return ret ;
600
603
601
604
err :
602
605
/* Similarly to __xmlOutputBufferCreateFilename we should also close the encoder on failure. */
@@ -992,7 +995,7 @@ static PHP_RINIT_FUNCTION(libxml)
992
995
* other threads/requests that might have disabled the loader
993
996
* do not affect the current request.
994
997
*/
995
- LIBXML (entity_loader_disabled ) = 0 ;
998
+ LIBXML (entity_loader_disabled ) = false ;
996
999
997
1000
return SUCCESS ;
998
1001
}
@@ -1094,7 +1097,7 @@ PHP_FUNCTION(libxml_use_internal_errors)
1094
1097
RETURN_BOOL (retval );
1095
1098
}
1096
1099
1097
- if (use_errors == 0 ) {
1100
+ if (use_errors == false ) {
1098
1101
xmlSetStructuredErrorFunc (NULL , NULL );
1099
1102
if (LIBXML (error_list )) {
1100
1103
zend_llist_destroy (LIBXML (error_list ));
@@ -1196,7 +1199,7 @@ PHP_LIBXML_API bool php_libxml_disable_entity_loader(bool disable) /* {{{ */
1196
1199
/* {{{ Disable/Enable ability to load external entities */
1197
1200
PHP_FUNCTION (libxml_disable_entity_loader )
1198
1201
{
1199
- bool disable = 1 ;
1202
+ bool disable = true ;
1200
1203
1201
1204
ZEND_PARSE_PARAMETERS_START (0 , 1 )
1202
1205
Z_PARAM_OPTIONAL
0 commit comments