diff --git a/plugins/views/views_php_handler_sort.inc b/plugins/views/views_php_handler_sort.inc
index cca24ba..c307584 100644
--- a/plugins/views/views_php_handler_sort.inc
+++ b/plugins/views/views_php_handler_sort.inc
@@ -70,10 +70,12 @@ class views_php_handler_sort extends views_handler_sort {
    */
   function php_post_execute() {
     if (!empty($this->options['php_sort']) && $this->view->style_plugin->build_sort()) {
-      $this->php_sort_function = create_function('$view, $handler, &$static, $row1, $row2', $this->options['php_sort'] . ';');
-      ob_start();
-      usort($this->view->result, array($this, 'php_sort'));
-      ob_end_clean();
+      if (!$this->options['exposed'] || $this->options['id'] === $this->view->exposed_raw_input['sort_by']) {
+        $this->php_sort_function = create_function('$view, $handler, &$static, $row1, $row2', $this->options['php_sort'] . ';');
+        ob_start();
+        usort($this->view->result, array($this, 'php_sort'));
+        ob_end_clean();
+      }
     }
   }
 
