| @@ -792,8 +792,24 @@ | ||
| 792 | 792 | return false; |
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | /** |
| 796 | + * Check for PHP execution in uploads | |
| 797 | + * | |
| 798 | + * @return string|false Error message or false if safe. | |
| 799 | + */ | |
| 800 | + private function check_php_in_uploads() { | |
| 801 | + $uri = $this->inspection_haystack(); | |
| 802 | + | |
| 803 | + // Check if accessing PHP in uploads directory | |
| 804 | + if ( preg_match( '/\/wp-content\/uploads\/.*\.ph(p[345s]?|tml)/i', $uri ) ) { | |
| 805 | + return __( 'PHP execution in uploads blocked', 'vigilante' ); | |
| 806 | + } | |
| 807 | + | |
| 808 | + return false; | |
| 809 | + } | |
| 810 | + | |
| 811 | + /** | |
| 796 | 812 | * Check for bad bots |
| 797 | 813 | * |
| 798 | 814 | * @return string|false Error message or false if safe. |
| 799 | 815 | */ |
| @@ -980,10 +996,10 @@ | ||
| 980 | 996 | |
| 981 | 997 | foreach ( $bad_bots as $bot ) { |
| 982 | 998 | if ( strpos( $user_agent, $bot ) !== false ) { |
| 983 | 999 | return sprintf( |
| 984 | - /* translators: %s: The entry of the bad bots list that was found in the User-Agent */ | |
| 985 | - __( 'Bad bot blocked: the User-Agent contains "%s"', 'vigilante' ), | |
| 1000 | + /* translators: %s: Bot name */ | |
| 1001 | + __( 'Bad bot blocked: %s', 'vigilante' ), | |
| 986 | 1002 | $bot |
| 987 | 1003 | ); |
| 988 | 1004 | } |
| 989 | 1005 | } |