| | 598 | * Check the path for a sub-directory site is correctly sanitised, |
| | 599 | * and has a trailing slash. |
| | 600 | * |
| | 601 | * @ticket 23865 |
| | 602 | */ |
| | 603 | function test_update_blog_sanitises_subdirectory_path() { |
| | 604 | global $test_action_counter; |
| | 605 | |
| | 606 | $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) ); |
| | 607 | $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/test_blogpath', 'title' => 'Test Title' ) ); |
| | 608 | $this->assertInternalType( 'int', $blog_id ); |
| | 609 | |
| | 610 | $result = update_blog_details( $blog_id, array('domain' => 'example.com', 'path' => 'my_path') ); |
| | 611 | |
| | 612 | $blog = get_blog_details( $blog_id ); |
| | 613 | $this->assertEquals( '/my_path/', $blog->path ); |
| | 614 | |
| | 615 | $result = update_blog_details( $blog_id, array('domain' => 'example.com', 'path' => 'my_path//') ); |
| | 616 | |
| | 617 | $blog = get_blog_details( $blog_id ); |
| | 618 | $this->assertEquals( '/my_path/', $blog->path ); |
| | 619 | |
| | 620 | $result = update_blog_details( $blog_id, array('domain' => 'example.com', 'path' => '/my_path') ); |
| | 621 | |
| | 622 | $blog = get_blog_details( $blog_id ); |
| | 623 | $this->assertEquals( '/my_path/', $blog->path ); |
| | 624 | } |
| | 625 | |
| | 626 | /** |