-----------------------------------------------
  HOTFIX for the Apache RAR/PHP vulnerability
-----------------------------------------------

To apply this hotfix, you need to replace or modify the following scripts:

- addpic.php
- db_input.php
- image_processor.php
- upload.php
- xp_publish.php
- include/functions.inc.php


------------------------
Un-modded 1.3.5 gallery: 
------------------------

(1) Simply replace these scripts.

(2) You're done.

(3) To test your gallery, read: http://coppermine-gallery.net/forum/index.php?topic=31534.0


----------------------------------
Modded gallery or < 1.3.5 gallery:
----------------------------------

(1) Search for the string "HOTFIX(ApacheRAR)" in each of these files.

(2) Compare the lines found with the lines in your modded scripts.

(3) For a line with "HOTFIX(ApacheRAR): remove -", remove the line.

(4) For a line with "HOTFIX(ApacheRAR): replace -", replace the line with the one that follows.

    For example, in the fixed addpic.php, you see: 
        // HOTFIX(ApacheRAR): replace - $sane_name = strtr($file_name, $forbidden_chars, str_repeat('_', strlen($CONFIG['forbiden_fname_char'])));
        $sane_name = replace_forbidden($file_name);

    So in your script, replace the first line:
        $sane_name = strtr($file_name, $forbidden_chars, str_repeat('_', strlen($CONFIG['forbiden_fname_char'])));
    With the following line:
        $sane_name = replace_forbidden($file_name);

(5) For include/functions.inc.php, you need to add the function replace_forbidden, as shown.
    Make sure to add it before the last line which is "?>".

(6) Make sure to address all lines with "HOTFIX(ApacheRAR)" in them.
    There are 2 such lines in addpic.php, db_input.php, and xp_publish.php.
    There are 4 such lines in image_processor.php and upload.php.
    There are 2 lines bracketing a function to add in include/functions.inc.php.

(7) Once you apply all the fixes, you are done.

(8) To test your gallery, read: http://coppermine-gallery.net/forum/index.php?topic=31534.0


-----------------
  end of readme
-----------------
