Changeset 937 in genappalpha for languages/html5/base.php


Ignore:
Timestamp:
Jun 29, 2016, 1:55:11 AM (6 years ago)
Author:
ehb
Message:

html5 : removed repeater restrictions, now general repeater structures allowed. Still alpha

File:
1 edited

Legend:

Unmodified
Added
Removed
  • languages/html5/base.php

    r936 r937  
    678678    {
    679679        $a = preg_split( "/-/", $v );
    680         $_REQUEST[ $a[ 0 ] ][ $a[ 1 ] - 1 ] = $_REQUEST[ $v ];
     680        __~debug:basemylog{error_log( "preg_split of $v:\n" . json_encode( $a, JSON_PRETTY_PRINT ), 3, "/tmp/mylog" );}
     681        if ( !isset( $_REQUEST[ $a[ 0 ] ] ) || !is_array( $_REQUEST[ $a[ 0 ] ] ) ) {
     682            $_REQUEST[ $a[ 0 ] ] = [];
     683        }
     684        $obj = &$_REQUEST[ $a[ 0 ] ];
     685        for ( $i = 1; $i < count( $a ) - 1; ++$i ) {
     686            if ( !isset( $obj[ $a[ $i ] ] ) || !is_array( $obj[ $a[ $i ] ] ) ) {
     687                $obj[ $a[ $i ] ] = [];
     688            }
     689            $obj = &$obj[ $a[ $i ] ];
     690        }
     691        $obj[ $a[ count( $a ) - 1 ] ] = $_REQUEST[ $v ];
     692        // $_REQUEST[ $a[ 0 ] ][ $a[ 1 ] - 1 ] = $_REQUEST[ $v ];
    681693        unset( $_REQUEST[ $v ] );
    682694    }
Note: See TracChangeset for help on using the changeset viewer.