Module: appdb
Branch: master
Commit: 7e5264a3d07133ee60495d2206f80daadbb28afd
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=7e5264a3d07133ee60495d22…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Date: Sun Sep 14 16:56:44 2008 +0200
util: Don't trim app descriptions away
---
include/util.php | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/include/util.php b/include/util.php
index 028edb6..49ddedf 100644
--- a/include/util.php
+++ b/include/util.php
@@ -922,14 +922,19 @@ function HtmlAreaLoaderScript($aTextareas)
*/
function util_trim_description($sDescription)
{
- // 1) let's take the first line of the description:
- $aDesc = explode("\n",trim($sDescription),2);
- // 2) maybe it's an html description and lines are separated with <br> or </p><p>
- $aDesc = explode("<br>",$aDesc[0],2);
- $aDesc = explode("<br />",$aDesc[0],2);
- $aDesc = explode("</p><p>",$aDesc[0],2);
- $aDesc = explode("</p><p /><p>",$aDesc[0],2);
- return trim(strip_tags($aDesc[0]));
+ // 1) maybe it's an html description and lines are separated with tags
+ $aReplace = array('<br>','<br />','</p><p>');
+ $sDescription = str_replace($aReplace, "\n", $sDescription);
+
+ // 2) let's split the dsecription into lines
+ $aDesc = explode("\n",trim($sDescription));
+
+ // 3) Avoid empty lines
+ for($i = 0; $i < sizeof($aDesc); $i++)
+ if(($sText = trim(strip_tags($aDesc[$i]))))
+ return $sText;
+
+ return '';
}
/* This allows us to pass on the current URL to the login form so that the user is returned
Module: appdb
Branch: master
Commit: f8fb363ce42eba353ac74f7871cb3663b2b9df0a
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=f8fb363ce42eba353ac74f78…
Author: Chris Morgan <cmorgan(a)alum.wpi.edu>
Date: Sun Sep 14 11:19:08 2008 -0400
filter_gpc() fix for "Fatal error: type of variable X is not recognized".
Ignore unknown gpc variables instead of failing with fatal errors as it isn't useful to report these errors to users. Firewalls or other programs may be inserting these cookies.
Properly store array variables if they are valid arrays.
---
include/filter.php | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/include/filter.php b/include/filter.php
index 4daf875..404e3a1 100644
--- a/include/filter.php
+++ b/include/filter.php
@@ -94,17 +94,16 @@ function filter_gpc()
}
break;
case "a": // array
- if(!is_array($_REQUEST[$aKeys[$i]]))
- return "Fatal error: ".$aKeys[$i]." should be an array. ".
- $sErrorSuggestion;
+ // store the value if it is an array
+ if(is_array($_REQUEST[$aKeys[$i]]))
+ $aClean[$aKeys[$i]] = $_REQUEST[$aKeys[$i]];
break;
default:
- return "Fatal error: type of variable ".$aKeys[$i]." is not recognized.".
- $sErrorSuggestion;
+ // type not recognized, skip it
break;
}
}
-
+
/* null out all input data so we can be assured that */
/* no unfiltered values are being used */
$_REQUEST = array();