Changeset 325


Ignore:
Timestamp:
Apr 26, 2008 4:40:58 AM (16 years ago)
Author:
quinn
Message:

Added a feature to App::dropQuery() to remove args permanently.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r318 r325  
    662662                // Copy the value of the specified query argument into the _carry_queries array.
    663663                $this->_carry_queries[$k] = getFormData($k, $default);
     664                $this->logMsg(sprintf('Carrying query: %s => %s', $k, $this->_carry_queries[$k]), LOG_DEBUG, __FILE__, __LINE__);
    664665            }
    665666        }
     
    669670     * dropQuery() is the opposite of carryQuery(). The specified value will not appear in
    670671     * url()/ohref()/printHiddenSession() modified URLs unless explicitly written in.
    671      *
     672     * 
    672673     * @access  public
    673674     * @param   mixed   $query_key  The key (or keys, as an array) of the query argument to remove.
     
    675676     * @since   18 Jun 2007 20:57:29
    676677     */
    677     function dropQuery($query_key, $default=false)
     678    function dropQuery($query_key, $unset=false)
    678679    {
    679680        if (!is_array($query_key)) {
     
    683684            if (isset($this->_carry_queries[$k])) {
    684685                // Remove the value of the specified query argument from the _carry_queries array.
     686                $this->logMsg(sprintf('Dropping carried query: %s => %s', $k, $this->_carry_queries[$k]), LOG_DEBUG, __FILE__, __LINE__);
    685687                unset($this->_carry_queries[$k]);
     688            }
     689            if ($unset && isset($_REQUEST[$k])) {
     690                unset($_REQUEST[$k], $_GET[$k], $_POST[$k], $_COOKIE[$k]);
    686691            }
    687692        }
     
    692697     * keys and values, including optional queries. This allows mindless retention
    693698     * of query arguments across page requests. If cookies are not
    694      * used, the session id will be propogated in the URL.
     699     * used, the session id will be propagated in the URL.
    695700     *
    696701     * @param  string $url              The initial url
Note: See TracChangeset for help on using the changeset viewer.