webcalendar

Check-in [d701842a8d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Replace dead old PHP API
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | master | trunk
Files: files | file ages | folders
SHA3-256:d701842a8d88e1fea09efee1b5148c21fdc6a956937dd3bcbcff01189dd267e5
User & Date: vandys 2019-04-10 23:56:50
Context
2019-04-10
23:56
Replace dead old PHP API Leaf check-in: d701842a8d user: vandys tags: master, trunk
2019-03-10
20:37
Fix "today" concept so it still works on daylight savings change days check-in: c847fd4b5f user: vandys tags: master, trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to includes/formvars.php.

    26     26       );
    27     27     $failed = false;
    28     28   
    29     29     if ( is_array ( $instr ) ) {
    30     30       for ( $j = 0; $j < count ( $instr ); $j++ ) {
    31     31         for ( $i = 0; $i < count ( $bannedTags ) && ! $failed; $i++ ) {
    32     32           // First, replace any escape characters like '\x3c'
    33         -        $teststr = preg_replace ( "#(\\\x[0-9A-F]{2})#e",
    34         -          "chr(hexdec('\\1'))", $instr[$j] );
           33  +        $teststr = preg_replace_callback("#(\\\x[0-9A-F]{2})#",
           34  +	    function($m) { return chr(hexdec($m[1])); },
           35  +	    $instr[$j]);
    35     36           if ( preg_match ( "/<\s*$bannedTags[$i]/i", $teststr ) ) {
    36     37             $failed = true;
    37     38           }
    38     39         }
    39     40       }
    40         -    if ( $failed ) {
    41         -      die_miserable_death ( translate ( 'Fatal Error' ) . ': '
    42         -         . translate ( 'Invalid data format for' ) . ' ' . $name );
    43         -    }
    44     41     } else {
    45     42       // Not an array
    46     43       // First, replace any escape characters like '\x3c'
    47         -    $teststr = preg_replace ( "#(\\\x[0-9A-F]{2})#e",
    48         -      "chr(hexdec('\\1'))", $instr );
           44  +    $teststr = preg_replace_callback("#(\\\x[0-9A-F]{2})#",
           45  +	function ($m) { return chr(hexdec($m[1])); },
           46  +	$instr);
    49     47       for ( $i = 0; $i < count ( $bannedTags ) && ! $failed; $i++ ) {
    50     48         if ( preg_match ( "/<\s*$bannedTags[$i]/i", $teststr ) ) {
    51     49           $failed = true;
    52     50         }
    53     51       }
    54         -    if ( $failed ) {
    55         -      die_miserable_death ( translate ( 'Fatal Error' ) . ': '
    56         -         . translate ( 'Invalid data format for' ) . ' ' . $name );
    57         -    }
           52  +  }
           53  +  if ( $failed ) {
           54  +    die_miserable_death ( translate ( 'Fatal Error' ) . ': '
           55  +       . translate ( 'Invalid data format for' ) . ' ' . $name );
    58     56     }
    59     57   }
    60     58   
    61     59   /* Gets the value resulting from an HTTP POST method.
    62     60    *
    63     61    * <b>Note:</b> The return value will be affected by the value of
    64     62    * <var>magic_quotes_gpc</var> in the php.ini file.