When using Drupal 7, how do I print the current search terms into a search form in a block?
In Drupal 6, I used something like this in my template.php:
$vars['search_keys'] = search_get_keys();
Then, in search-theme-form.tpl.php I had:
<input type="text" value="<?php print $search_keys; ?> name="search_theme_form" id="edit-search-theme-form-1">
But search_get_keys doesn't exist in Drupal 7, so I can't use this method.
Using arg(2) is the only method I've come up with, but that seems a little hacky, because it will break if the URL ever changes.