Skip to content

Commit

Permalink
Better workaround for HHVM
Browse files Browse the repository at this point in the history
  • Loading branch information
rmccue committed Jan 20, 2015
1 parent 259caeb commit f41aed8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hm-rewrites.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,17 +397,17 @@ function hm_add_rewrite_rule( $args = array() ) {

// backwards compat
if ( count( func_get_args() ) > 1 && is_string( $args ) ) {
$provided = func_get_args();

$regex = $args;
$args = array();
$args['regex'] = $regex;
$args['query'] = func_get_arg( 1 );
$args['regex'] = $provided[0];
$args['query'] = $provided[1];

if ( count( func_get_args() ) > 2 )
$args['template'] = func_get_arg( 2 );
if ( count( $provided ) > 2 )
$args['template'] = $provided[2];

if ( count( func_get_args() ) > 3 )
$args = array_merge( $args, func_get_arg( 3 ) );
if ( count( $provided ) > 3 )
$args = array_merge( $args, $provided[3] );
}

if ( ! empty( $args['rewrite'] ) )
Expand Down

0 comments on commit f41aed8

Please sign in to comment.