added $secure to segment_replace(); introduced update_query_string(). closes #1458