$OpenBSD: patch-libraries_structure_lib_php,v 1.1 2014/07/03 13:13:59 giovanni Exp $
Fix for CVE-2014-4348
--- libraries/structure.lib.php.orig	Thu Jun 26 11:25:45 2014
+++ libraries/structure.lib.php	Thu Jun 26 11:27:54 2014
@@ -2735,9 +2735,8 @@ function PMA_checkFavoriteTable($db, $current_table)
 function PMA_getHtmlForFavoriteAnchor($db, $current_table, $titles)
 {
     $html_output  = '<a ';
-    $html_output .= 'id="' . preg_replace(
-        '/\s+/', '', $current_table['TABLE_NAME']
-    ) . '_favorite_anchor" ';
+    $html_output .= 'id="' . md5($current_table['TABLE_NAME'])
+        . '_favorite_anchor" ';
     $html_output .= 'class="ajax favorite_table_anchor';
 
     // Check if current table is already in favorite list.
@@ -2751,7 +2750,7 @@ function PMA_getHtmlForFavoriteAnchor($db, $current_ta
     $html_output .= 'href="' . $fav_url
         . '" title="' . ($already_favorite ? __("Remove from Favorites")
         : __("Add to Favorites"))
-        . '" data-favtargets="' . $db . "." . $current_table['TABLE_NAME']
+        . '" data-favtargets="' . md5($db . "." . $current_table['TABLE_NAME'])
         . '" >'
         . (!$already_favorite ? $titles['NoFavorite']
         : $titles['Favorite']) . '</a>';
