[xiph-commits] r14851 - in branches/dir.xiph.org: . cgi-bin css inc inc/smarty-plugins

balbinus at svn.xiph.org balbinus at svn.xiph.org
Sat May 10 07:53:29 PDT 2008


Author: balbinus
Date: 2008-05-10 07:53:27 -0700 (Sat, 10 May 2008)
New Revision: 14851

Modified:
   branches/dir.xiph.org/by_format.php
   branches/dir.xiph.org/by_genre.php
   branches/dir.xiph.org/cgi-bin/yp.php
   branches/dir.xiph.org/css/style.css
   branches/dir.xiph.org/inc/lib.apilog.php
   branches/dir.xiph.org/inc/smarty-plugins/modifier.force_utf8.php
   branches/dir.xiph.org/search.php
Log:
Modifications batch.

Modified: branches/dir.xiph.org/by_format.php
===================================================================
--- branches/dir.xiph.org/by_format.php	2008-05-09 23:14:52 UTC (rev 14850)
+++ branches/dir.xiph.org/by_format.php	2008-05-10 14:53:27 UTC (rev 14851)
@@ -67,7 +67,7 @@
                 }
 		elseif ($page_n + PAGES_IN_PAGER > $results_pages)
 		{
-		    $pages = range($results_pages - PAGES_IN_PAGER, $results_pages);
+		    $pages = range($results_pages - PAGES_IN_PAGER + 1, $results_pages);
 		}
                 else
                 {

Modified: branches/dir.xiph.org/by_genre.php
===================================================================
--- branches/dir.xiph.org/by_genre.php	2008-05-09 23:14:52 UTC (rev 14850)
+++ branches/dir.xiph.org/by_genre.php	2008-05-10 14:53:27 UTC (rev 14851)
@@ -70,7 +70,7 @@
                 }
                 elseif ($page_n + PAGES_IN_PAGER > $results_pages)
                 {
-                    $pages = range($results_pages - PAGES_IN_PAGER, $results_pages);
+                    $pages = range($results_pages - PAGES_IN_PAGER + 1, $results_pages);
                 }
                 else
                 {

Modified: branches/dir.xiph.org/cgi-bin/yp.php
===================================================================
--- branches/dir.xiph.org/cgi-bin/yp.php	2008-05-09 23:14:52 UTC (rev 14850)
+++ branches/dir.xiph.org/cgi-bin/yp.php	2008-05-10 14:53:27 UTC (rev 14851)
@@ -46,7 +46,7 @@
 		    $mandatory_args = array('sn', 'type', 'genre', 'b', 'listenurl');
 		    foreach ($mandatory_args as $a)
 		    {
-		        if (!array_key_exists($a, $_REQUEST))
+		        if (!array_key_exists($a, $_REQUEST) || empty($_REQUEST[$a]))
 		        {
 			        throw new ServerRefusedAPIException('Not enough arguments.', SERVER_REFUSED_MISSING_ARG);
 		        }
@@ -60,14 +60,14 @@
 		    $media_type = strtolower(clean_string($_REQUEST['type']));
 		    if (array_key_exists('stype', $_REQUEST))
 		    {
-			    if (preg_match('/vorbis/i', $_REQUEST['stype']))
-			    {
-				    $media_type .= '+vorbis';
-			    }
 			    if (preg_match('/theora/i', $_REQUEST['stype']))
 			    {
 				    $media_type .= '+theora';
 			    }
+			    elseif (preg_match('/vorbis/i', $_REQUEST['stype']))
+			    {
+				    $media_type .= '+vorbis';
+			    }
 		    }
 		    // Genre, space-normalized
 		    $genre = clean_string($_REQUEST['genre']);
@@ -228,7 +228,7 @@
 		    $mandatory_args = array('sid');
 		    foreach ($mandatory_args as $a)
 		    {
-		        if (!array_key_exists($a, $_REQUEST))
+		        if (!array_key_exists($a, $_REQUEST) || empty($_REQUEST[$a]))
 		        {
 			        // Return failure
 			        header("YPResponse: 0");
@@ -324,7 +324,7 @@
 		    $mandatory_args = array('sid');
 		    foreach ($mandatory_args as $a)
 		    {
-		        if (!array_key_exists($a, $_REQUEST))
+		        if (!array_key_exists($a, $_REQUEST) || empty($_REQUEST[$a]))
 		        {
 			        // Return failure
 			        header("YPResponse: 0");

Modified: branches/dir.xiph.org/css/style.css
===================================================================
--- branches/dir.xiph.org/css/style.css	2008-05-09 23:14:52 UTC (rev 14850)
+++ branches/dir.xiph.org/css/style.css	2008-05-10 14:53:27 UTC (rev 14851)
@@ -3,10 +3,18 @@
 	padding-left: 3em;
 }
 
+#navbar {
+	width: 150px;
+}
+
 #navbar h3 {
 	font-size: 0.9em;
 }
 
+#content {
+	margin-left: 160px;
+}
+
 h2 {
 	font-size: 1.5em;
 }

Modified: branches/dir.xiph.org/inc/lib.apilog.php
===================================================================
--- branches/dir.xiph.org/inc/lib.apilog.php	2008-05-09 23:14:52 UTC (rev 14850)
+++ branches/dir.xiph.org/inc/lib.apilog.php	2008-05-10 14:53:27 UTC (rev 14851)
@@ -10,7 +10,7 @@
         try
         {
             $db->noReturnQuery('SELECT 0 INTO @prev_id;');
-            $db->noReturnQuery('UPDATE api_log_cpt SET `id_log` = ((`id_log` MOD 10000) + 1) WHERE @prev_id := `id_log;`');
+            $db->noReturnQuery('UPDATE api_log_cpt SET `id_log` = ((`id_log` MOD 10000) + 1) WHERE @prev_id := `id_log`;');
             $res = $db->singleQuery('SELECT @prev_id AS id;');
             $id = $res->current('id');
             

Modified: branches/dir.xiph.org/inc/smarty-plugins/modifier.force_utf8.php
===================================================================
--- branches/dir.xiph.org/inc/smarty-plugins/modifier.force_utf8.php	2008-05-09 23:14:52 UTC (rev 14850)
+++ branches/dir.xiph.org/inc/smarty-plugins/modifier.force_utf8.php	2008-05-10 14:53:27 UTC (rev 14851)
@@ -4,6 +4,7 @@
 
 function smarty_modifier_force_utf8($str)
 {
+	$str = mb_ereg_replace('[[:cntrl:]]', '', $str);
 	return utils::is_utf8($str) ? $str : utf8_encode($str);
 }
 ?>

Modified: branches/dir.xiph.org/search.php
===================================================================
--- branches/dir.xiph.org/search.php	2008-05-09 23:14:52 UTC (rev 14850)
+++ branches/dir.xiph.org/search.php	2008-05-10 14:53:27 UTC (rev 14851)
@@ -110,7 +110,7 @@
         	        }
                 	elseif ($page_n + PAGES_IN_PAGER > $results_pages)
         	        {
-	                    $pages = range($results_pages - PAGES_IN_PAGER, $results_pages);
+	                    $pages = range($results_pages - PAGES_IN_PAGER + 1, $results_pages);
                 	}
         	        else
 	                {



More information about the commits mailing list