Plugin Directory

Changeset 1680740


Ignore:
Timestamp:
06/18/2017 07:17:04 PM (9 years ago)
Author:
abjelosevic
Message:

Fix bug with disable directory browsing

Location:
ab-wp-security
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • ab-wp-security/trunk/ab-wp-security-plugin.php

    r1668817 r1680740  
    44   Plugin URI: http://aleksandar.bjelosevic.info/abwps
    55   Description: Security plugin that stop User Enumeration in WordPress,check for admin and administrator usernames, Disable XML-RPC,Remove WordPress Version Number and disable directory browsing
    6    Version: 1.50
     6   Version: 1.51
    77   Author: Aleksandar Bjelosevic
    88   Author URI: http://aleksandar.bjelosevic.info
     
    168168                if (copy(".htaccess",".htaccessCopy")) //
    169169                {
    170                    $myfile = fopen($filename, "a") or die("Unable to open file!");
    171                    $txt = "Options All -Indexes";
     170                     $txt = "Options All -Indexes";
     171                   $contents = file_get_contents($filename);
     172                   $pattern = preg_quote($txt, '/');
     173                   $pattern = "/^.*$pattern.*\$/m";
     174
     175                   if(preg_match_all($pattern, $contents, $matches)){
     176                      fclose ($filename);
     177                      }
     178                    else{
     179                        $myfile = fopen($filename, "a") or die("Unable to open file!");
     180                 
    172181                   fwrite($myfile, "\n". $txt);
    173182                   fclose($myfile);
     183                       
     184                        }
     185                   
     186                   
     187                   
    174188                }
    175189           
  • ab-wp-security/trunk/readme.txt

    r1668832 r1680740  
    44Tags: security, enumeration, block,Disable XML-RPC,Remove WordPress Version Number, disable directory browsing
    55Requires at least: 3.8
    6 Tested up to: 4.7.4
    7 Stable tag: 1.50
     6Tested up to: 4.7.5
     7Stable tag: 1.51
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl.html
     
    2222
    2323== Changelog ==
     24
     25= V1.51 =
     26Fix bug with disable directory browsing
    2427
    2528= V1.50 =
Note: See TracChangeset for help on using the changeset viewer.