Development

#5175 (generate_shortest_url cannot accept the int 0)

You must first sign up to be able to contribute.

Ticket #5175 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

generate_shortest_url cannot accept the int 0

Reported by: river.bright Assigned to: FabianLange
Priority: minor Milestone: 1.2.1
Component: routing Version: 1.2.0
Keywords: generate_shortest_url Cc:
Qualification: Accepted

Description

If I use "generate_shortest_url: true", and create a url like below

<a href="<?php echo url_for('@hoge?' . http_build_query(array('param1' => "aa", 'param2' => 0))) ?>" >link</a>

The rendered HTML is below

<a href="/frontend_dev.php/hoge?param1=aaa">link</a>

The "param2" was ignored because of the array_filter method in sfRoute.class.php

    if ($this->options['extra_parameters_as_query_string'] && !$this->hasStarParameter())
    {
      // add a query string if needed
      if ($extra = array_diff_key(array_filter($params), $this->variables, $defaults))
      {
        $url .= '?'.http_build_query($extra);
      }
    }

I think to remove this "array_filter" method in this logic.

Change History

12/05/08 22:33:07 changed by FabianLange

  • milestone set to 1.2.1.

fabien can we remove the array_filter here as well?

12/10/08 22:54:52 changed by FabianLange

  • owner changed from fabien to FabianLange.
  • status changed from new to assigned.
  • qualification changed from Unreviewed to Accepted.

12/10/08 22:54:55 changed by FabianLange

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [13928]) [1.2] fixed remaining array_filter in sfRoute. fixes #5175

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.