The branch, master has been updated
       via  ffe203b09952de76eef527dec4a4c354bf90302e (commit)
      from  765d823bbda19c506567144446e1727990ac78d0 (commit)


- Log -----------------------------------------------------------------
commit ffe203b09952de76eef527dec4a4c354bf90302e
Author: Michal Čihař <[email protected]>
Date:   Mon Jul 25 14:38:05 2011 +0200

    Simplify definition of new valid links

-----------------------------------------------------------------------

Summary of changes:
 libraries/sanitizing.lib.php |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/libraries/sanitizing.lib.php b/libraries/sanitizing.lib.php
index 028149c..2c3e28c 100644
--- a/libraries/sanitizing.lib.php
+++ b/libraries/sanitizing.lib.php
@@ -15,14 +15,19 @@
  */
 function PMA_checkLink($url)
 {
-    if (substr($url, 0, 7) == 'http://') {
-        return true;
-    } elseif (substr($url, 0, 8) == 'https://') {
-        return true;
-    } elseif (!defined('PMA_SETUP') && substr($url, 0, 20) == 
'./Documentation.html') {
-        return true;
-    } elseif (defined('PMA_SETUP') && substr($url, 0, 21) == 
'../Documentation.html') {
-        return true;
+    $valid_starts = array(
+        'http://',
+        'https://',
+    );
+    if (defined('PMA_SETUP')) {
+        $valid_starts[] = '../Documentation.html';
+    } else {
+        $valid_starts[] = './Documentation.html';
+    }
+    foreach($valid_starts as $val) {
+        if (substr($url, 0, strlen($val)) == $val) {
+            return true;
+        }
     }
     return false;
 }


hooks/post-receive
-- 
phpMyAdmin

------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
Phpmyadmin-git mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-git

Reply via email to