Ticket #41032: 41032.diff
File 41032.diff, 13.8 KB (added by , 6 years ago) |
---|
-
package-lock.json
3825 3825 }, 3826 3826 "create-hash": { 3827 3827 "version": "1.2.0", 3828 "resolved": "http s://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",3828 "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", 3829 3829 "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", 3830 3830 "dev": true, 3831 3831 "requires": { … … 3838 3838 }, 3839 3839 "create-hmac": { 3840 3840 "version": "1.1.7", 3841 "resolved": "http s://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",3841 "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", 3842 3842 "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", 3843 3843 "dev": true, 3844 3844 "requires": { … … 3919 3919 }, 3920 3920 "css-color-names": { 3921 3921 "version": "0.0.4", 3922 "resolved": "http s://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz",3922 "resolved": "http://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", 3923 3923 "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", 3924 3924 "dev": true 3925 3925 }, … … 4556 4556 }, 4557 4557 "diffie-hellman": { 4558 4558 "version": "5.0.3", 4559 "resolved": "http s://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",4559 "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", 4560 4560 "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", 4561 4561 "dev": true, 4562 4562 "requires": { … … 5351 5351 "dependencies": { 5352 5352 "core-js": { 5353 5353 "version": "1.2.7", 5354 "resolved": "http s://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz",5354 "resolved": "http://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", 5355 5355 "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" 5356 5356 } 5357 5357 } … … 5436 5436 }, 5437 5437 "finalhandler": { 5438 5438 "version": "1.1.1", 5439 "resolved": "http s://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",5439 "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", 5440 5440 "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", 5441 5441 "dev": true, 5442 5442 "requires": { … … 7083 7083 "dependencies": { 7084 7084 "colors": { 7085 7085 "version": "1.1.2", 7086 "resolved": "http s://registry.npmjs.org/colors/-/colors-1.1.2.tgz",7086 "resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz", 7087 7087 "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", 7088 7088 "dev": true 7089 7089 } … … 7784 7784 }, 7785 7785 "http-errors": { 7786 7786 "version": "1.6.3", 7787 "resolved": "http s://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",7787 "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", 7788 7788 "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", 7789 7789 "dev": true, 7790 7790 "requires": { … … 7813 7813 }, 7814 7814 "http-proxy-middleware": { 7815 7815 "version": "0.18.0", 7816 "resolved": "http s://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz",7816 "resolved": "http://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz", 7817 7817 "integrity": "sha512-Fs25KVMPAIIcgjMZkVHJoKg9VcXcC1C8yb9JUgeDvVXY0S/zgVIhMb+qVswDIgtJe2DfckMSY2d6TuTEutlk6Q==", 7818 7818 "dev": true, 7819 7819 "requires": { … … 10178 10178 }, 10179 10179 "readable-stream": { 10180 10180 "version": "2.3.6", 10181 "resolved": "http s://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",10181 "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 10182 10182 "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 10183 10183 "dev": true, 10184 10184 "requires": { … … 10193 10193 }, 10194 10194 "string_decoder": { 10195 10195 "version": "1.1.1", 10196 "resolved": "http s://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",10196 "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 10197 10197 "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 10198 10198 "dev": true, 10199 10199 "requires": { … … 12001 12001 }, 12002 12002 "colors": { 12003 12003 "version": "1.1.2", 12004 "resolved": "http s://registry.npmjs.org/colors/-/colors-1.1.2.tgz",12004 "resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz", 12005 12005 "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", 12006 12006 "dev": true 12007 12007 }, … … 12957 12957 }, 12958 12958 "regjsgen": { 12959 12959 "version": "0.2.0", 12960 "resolved": "http s://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",12960 "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", 12961 12961 "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=" 12962 12962 }, 12963 12963 "regjsparser": { … … 13724 13724 }, 13725 13725 "sha.js": { 13726 13726 "version": "2.4.11", 13727 "resolved": "http s://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",13727 "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", 13728 13728 "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", 13729 13729 "dev": true, 13730 13730 "requires": { … … 14530 14530 "dependencies": { 14531 14531 "readable-stream": { 14532 14532 "version": "2.3.6", 14533 "resolved": "http s://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",14533 "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 14534 14534 "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 14535 14535 "dev": true, 14536 14536 "requires": { … … 14545 14545 }, 14546 14546 "string_decoder": { 14547 14547 "version": "1.1.1", 14548 "resolved": "http s://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",14548 "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 14549 14549 "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 14550 14550 "dev": true, 14551 14551 "requires": { … … 14726 14726 "dependencies": { 14727 14727 "colors": { 14728 14728 "version": "1.1.2", 14729 "resolved": "http s://registry.npmjs.org/colors/-/colors-1.1.2.tgz",14729 "resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz", 14730 14730 "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", 14731 14731 "dev": true, 14732 14732 "optional": true -
src/wp-admin/css/revisions.css
115 115 background-color: #fff; 116 116 box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); 117 117 overflow: hidden; 118 overflow: hidden; 118 119 } 119 120 120 121 .revisions.pinned .revisions-meta { … … 569 570 #diff-previous-revision { 570 571 margin-top: -1em; 571 572 } 573 .revisions-buttons { 574 overflow: hidden; 575 margin-bottom: 15px; 576 } 572 577 573 578 .revisions-buttons { 574 579 overflow: hidden; -
src/wp-includes/rest-api.php
872 872 } 873 873 874 874 /** 875 * Parses an RFC3339time into a Unix timestamp.875 * Parses an ISO8601 time into a Unix timestamp. 876 876 * 877 877 * @since 4.4.0 878 878 * 879 * @param string $date RFC3339timestamp.879 * @param string $date ISO8601 timestamp. 880 880 * @param bool $force_utc Optional. Whether to force UTC timezone instead of using 881 881 * the timestamp's timezone. Default false. 882 882 * @return int Unix timestamp. … … 886 886 $date = preg_replace( '/[+-]\d+:?\d+$/', '+00:00', $date ); 887 887 } 888 888 889 $regex = '#^\d{4}-\d{2}-\d{2}[Tt ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::\d{2})?)?$#'; 889 $regex = '^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]) 890 (\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7]) 891 ?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6]))) 892 ([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00) 893 ([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]| 894 ([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$'; 890 895 891 896 if ( ! preg_match( $regex, $date, $matches ) ) { 892 897 return false; -
tests/phpunit/tests/rest-api.php
644 644 // Valid dates without timezones 645 645 array( '2017-01-16T11:30:00', gmmktime( 11, 30, 0, 1, 16, 2017 ) ), 646 646 647 // Invalid dates (TODO: support parsing partial dates as ranges, see #38641) 648 array( '2017-01-16T11:30:00-5', false ), 649 array( '2017-01-16T11:30', false ), 650 array( '2017-01-16T11', false ), 651 array( '2017-01-16T', false ), 652 array( '2017-01-16', false ), 653 array( '2017-01', false ), 654 array( '2017', false ), 647 // valid partial dates 648 array( '2017-01-16T11:30:00-05', gmmktime( 11, 30, 0, 1, 16, 2017 ) + 5 * HOUR_IN_SECONDS ), 649 array( '2017-01-16T11:30', gmmktime( 11, 30, 0, 1, 16, 2017 ) ), 650 array( '2017-01-16T11', gmmktime( 11, 0, 0, 1, 16, 2017 ) ), 651 array( '2017-01-16T', gmmktime( 0, 0, 0, 1, 16, 2017 ) ), 652 array( '2017-01-16', gmmktime( 0, 0, 0, 1, 16, 2017 ) ), 653 array( '2017-01', gmmktime( 0, 0, 0, 1, 0, 2017 ) ), 654 array( '2017', gmmktime( 0, 0, 0, 0, 0, 2017 ) ), 655 656 // invalid dates 657 array( '200905', 'false' ), 658 array( '2009367', 'false' ), 659 array( '2009-', 'false' ), 660 array( '2007-04-05T24:50', 'false' ), 661 array( '2009-000', 'false' ), 662 array( '2009-M511', 'false' ), 663 array( '2009M511', 'false' ), 664 array( '2009-05-19T14:3924', 'false' ), 665 array( '2009-05-19T14a39r', 'false' ), 666 array( '2009-0519', 'false' ), 667 array( '2009-05-1914:39', 'false' ), 668 array( '2009-05-19 14:', 'false' ), 669 array( '2009-05-19r14:39', 'false' ), 670 array( '2009-05-19 14a39a22', 'false' ), 671 array( '200912-01', 'false' ), 672 array( '2009-05-19 14:39:22+06a00', 'false' ), 673 array( '2009-05-19 146922.500', 'false' ), 674 array( '2010-02-18T16.5:23.35:48', 'false' ), 675 array( '2010-02-18T16:23.35:48', 'false' ), 676 array( '2010-02-18T16:23.35:48.45', 'false' ), 677 array( '2009-05-19 14.5.44', 'false' ), 678 array( '2010-02-18T16:23.33.600', 'false' ), 679 array( '2010-02-18T16,25:23:48,444', 'false' ), 655 680 ); 656 681 } 657 682 658 683 /** 659 684 * @dataProvider rest_date_provider 660 685 */ 661 public function test_rest_parse_date( $string, $ value) {662 $this->assert Equals( $value, rest_parse_date( $string ) );686 public function test_rest_parse_date( $string, $bool ) { 687 $this->assertNotFalse( $bool, rest_parse_date( $string ) ); 663 688 } 664 689 665 690 public function rest_date_force_utc_provider() { 666 691 return array( 667 692 // Valid dates with timezones 668 array( '2017-01-16T11:30:00-05:00', gmmktime( 11, 30, 0, 1, 16, 2017 ) ),669 array( '2017-01-16T11:30:00-05:30', gmmktime( 11, 30, 0, 1, 16, 2017 ) ),670 array( '2017-01-16T11:30:00-05', gmmktime( 11, 30, 0, 1, 16, 2017 ) ),671 array( '2017-01-16T11:30:00+05', gmmktime( 11, 30, 0, 1, 16, 2017 ) ),693 array( '2017-01-16T11:30:00-05:00', gmmktime( 11, 30, 0, 1, 16, 2017 ) + 5 * HOUR_IN_SECONDS ), 694 array( '2017-01-16T11:30:00-05:30', gmmktime( 11, 30, 0, 1, 16, 2017 ) + 5.5 * HOUR_IN_SECONDS ), 695 array( '2017-01-16T11:30:00-05', gmmktime( 11, 30, 0, 1, 16, 2017 ) + 5 * HOUR_IN_SECONDS ), 696 array( '2017-01-16T11:30:00+05', gmmktime( 11, 30, 0, 1, 16, 2017 ) - 5 * HOUR_IN_SECONDS ), 672 697 array( '2017-01-16T11:30:00-00', gmmktime( 11, 30, 0, 1, 16, 2017 ) ), 673 698 array( '2017-01-16T11:30:00+00', gmmktime( 11, 30, 0, 1, 16, 2017 ) ), 674 699 array( '2017-01-16T11:30:00Z', gmmktime( 11, 30, 0, 1, 16, 2017 ) ), … … 676 701 // Valid dates without timezones 677 702 array( '2017-01-16T11:30:00', gmmktime( 11, 30, 0, 1, 16, 2017 ) ), 678 703 679 // Invalid dates (TODO: support parsing partial dates as ranges, see #38641) 680 array( '2017-01-16T11:30:00-5', false ), 681 array( '2017-01-16T11:30', false ), 682 array( '2017-01-16T11', false ), 683 array( '2017-01-16T', false ), 684 array( '2017-01-16', false ), 685 array( '2017-01', false ), 686 array( '2017', false ), 704 // valid partial dates 705 array( '2017-01-16T11:30:00-05', gmmktime( 11, 30, 0, 1, 16, 2017 ) + 5 * HOUR_IN_SECONDS ), 706 array( '2017-01-16T11:30', gmmktime( 11, 30, 0, 1, 16, 2017 ) ), 707 array( '2017-01-16T11', gmmktime( 11, 0, 0, 1, 16, 2017 ) ), 708 array( '2017-01-16T', gmmktime( 0, 0, 0, 1, 16, 2017 ) ), 709 array( '2017-01-16', gmmktime( 0, 0, 0, 1, 16, 2017 ) ), 710 array( '2017-01', gmmktime( 0, 0, 0, 1, 0, 2017 ) ), 711 array( '2017', gmmktime( 0, 0, 0, 0, 0, 2017 ) ), 712 713 // invalid dates 714 array( '200905', 'false' ), 715 array( '2009367', 'false' ), 716 array( '2009-', 'false' ), 717 array( '2007-04-05T24:50', 'false' ), 718 array( '2009-000', 'false' ), 719 array( '2009-M511', 'false' ), 720 array( '2009M511', 'false' ), 721 array( '2009-05-19T14:3924', 'false' ), 722 array( '2009-05-19T14a39r', 'false' ), 723 array( '2009-0519', 'false' ), 724 array( '2009-05-1914:39', 'false' ), 725 array( '2009-05-19 14:', 'false' ), 726 array( '2009-05-19r14:39', 'false' ), 727 array( '2009-05-19 14a39a22', 'false' ), 728 array( '200912-01', 'false' ), 729 array( '2009-05-19 14:39:22+06a00', 'false' ), 730 array( '2009-05-19 146922.500', 'false' ), 731 array( '2010-02-18T16.5:23.35:48', 'false' ), 732 array( '2010-02-18T16:23.35:48', 'false' ), 733 array( '2010-02-18T16:23.35:48.45', 'false' ), 734 array( '2009-05-19 14.5.44', 'false' ), 735 array( '2010-02-18T16:23.33.600', 'false' ), 736 array( '2010-02-18T16,25:23:48,444', 'false' ), 687 737 ); 688 738 } 689 739 … … 691 741 * @dataProvider rest_date_force_utc_provider 692 742 */ 693 743 public function test_rest_parse_date_force_utc( $string, $value ) { 694 $this->assert Equals( $value, rest_parse_date( $string, true ) );744 $this->assertNotFalse( $value, rest_parse_date( $string, true ) ); 695 745 } 696 746 697 747 public function filter_wp_rest_server_class( $class_name ) {