original_string: protected function LinkWithSearch($link) {
          // Whitelist to avoid side effects
          $params=array(
                      'q'=>(array)$this->request->getVar('q'),
                      'tag'=>$this->request->getVar('tag'),
                      'creator'=>$this->request->getVar('creator'),
                      'ParentID'=>$this->request->getVar('ParentID')
                  );
          
          $link=Controller::join_links(
                                      $link,
                                      (array_filter(array_values($params)) ? '?'.http_build_query($params):null)
                                  );
          
          $this->extend('updateLinkWithSearch', $link);
          return $link;
      }
code: protected function LinkWithSearch($link) {
          // Whitelist to avoid side effects
          $params=array(
                      'q'=>(array)$this->request->getVar('q'),
                      'tag'=>$this->request->getVar('tag'),
                      'creator'=>$this->request->getVar('creator'),
                      'ParentID'=>$this->request->getVar('ParentID')
                  );
          
          $link=Controller::join_links(
                                      $link,
                                      (array_filter(array_values($params)) ? '?'.http_build_query($params):null)
                                  );
          
          $this->extend('updateLinkWithSearch', $link);
          return $link;
      }
code_tokens: protected function LinkWithSearch ( $ link ) { // Whitelist to avoid side effects $ params = array ( 'q' => ( array ) $ this -> request -> getVar ( 'q' ) , 'tag' => $ this -> request -> getVar ( 'tag' ) , 'creator' => $ this -> request -> getVar ( 'creator' ) , 'ParentID' => $ this -> request -> getVar ( 'ParentID' ) ) ; $ link = Controller :: join_links ( $ link , ( array_filter ( array_values ( $ params ) ) ? '?' . http_build_query ( $ params ) : null ) ) ; $ this -> extend ( 'updateLinkWithSearch' , $ link ) ; return $ link ; }
docstring: Generates the link with search params
  @param {string} Link to
  @return {string} Link with search params
docstring_tokens: Generates the link with search params