File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ PHP NEWS
7171- Enchant:
7272 . Added enchant_dict_remove_from_session(). (nielsdos)
7373 . Added enchant_dict_remove(). (nielsdos)
74+ . Fix missing empty string checks. (nielsdos)
7475
7576- EXIF:
7677 . Add OffsetTime* Exif tags. (acc987)
Original file line number Diff line number Diff line change @@ -529,6 +529,11 @@ PHP_FUNCTION(enchant_broker_dict_exists)
529529
530530 PHP_ENCHANT_GET_BROKER ;
531531
532+ if (taglen == 0 ) {
533+ zend_argument_must_not_be_empty_error (2 );
534+ RETURN_THROWS ();
535+ }
536+
532537 RETURN_BOOL (enchant_broker_dict_exists (pbroker -> pbroker , tag ));
533538}
534539/* }}} */
@@ -554,6 +559,16 @@ PHP_FUNCTION(enchant_broker_set_ordering)
554559
555560 PHP_ENCHANT_GET_BROKER ;
556561
562+ if (ptaglen == 0 ) {
563+ zend_argument_must_not_be_empty_error (2 );
564+ RETURN_THROWS ();
565+ }
566+
567+ if (porderinglen == 0 ) {
568+ zend_argument_must_not_be_empty_error (3 );
569+ RETURN_THROWS ();
570+ }
571+
557572 enchant_broker_set_ordering (pbroker -> pbroker , ptag , pordering );
558573 RETURN_TRUE ;
559574}
Original file line number Diff line number Diff line change 1+ --TEST--
2+ enchant_broker_dict_exists() function - empty tag
3+ --EXTENSIONS--
4+ enchant
5+ --FILE--
6+ <?php
7+ $ broker = enchant_broker_init ();
8+ try {
9+ enchant_broker_dict_exists ($ broker , '' );
10+ } catch (ValueError $ e ) {
11+ echo $ e ->getMessage (), "\n" ;
12+ }
13+ echo "Done \n" ;
14+ ?>
15+ --EXPECT--
16+ enchant_broker_dict_exists(): Argument #2 ($tag) must not be empty
17+ Done
Original file line number Diff line number Diff line change 1+ --TEST--
2+ enchant_broker_set_ordering() function - empty tag
3+ --EXTENSIONS--
4+ enchant
5+ --FILE--
6+ <?php
7+ $ broker = enchant_broker_init ();
8+ try {
9+ enchant_broker_set_ordering ($ broker , '' , '' );
10+ } catch (ValueError $ e ) {
11+ echo $ e ->getMessage (), "\n" ;
12+ }
13+ try {
14+ enchant_broker_set_ordering ($ broker , '* ' , '' );
15+ } catch (ValueError $ e ) {
16+ echo $ e ->getMessage (), "\n" ;
17+ }
18+ echo "Done \n" ;
19+ ?>
20+ --EXPECT--
21+ enchant_broker_set_ordering(): Argument #2 ($tag) must not be empty
22+ enchant_broker_set_ordering(): Argument #3 ($ordering) must not be empty
23+ Done
You can’t perform that action at this time.
0 commit comments