[audacity] r14009 committed - Fix a bunch of PHP Notices related to incorrect variable checks, and a...

1 view
Skip to first unread message

auda...@googlecode.com

unread,
Jul 27, 2015, 7:42:19 PM7/27/15
to audaci...@googlegroups.com
Revision: 14009
Author: bua...@gmail.com
Date: Mon Jul 27 23:42:04 2015 UTC
Log: Fix a bunch of PHP Notices related to incorrect variable checks,
and a variable name typo.

https://code.google.com/p/audacity/source/detail?r=14009

Modified:
/website/trunk/htdocs/download/index.php
/website/trunk/htdocs/help/faq_i18n.php
/website/trunk/htdocs/include/header.inc.php
/website/trunk/htdocs/include/lang.inc.php

=======================================
--- /website/trunk/htdocs/download/index.php Tue Jul 14 05:42:30 2015 UTC
+++ /website/trunk/htdocs/download/index.php Mon Jul 27 23:42:04 2015 UTC
@@ -14,7 +14,7 @@
// include "../beta/versions.inc.php";
// include "../legacy/versions.inc.php";
$stable_version = stable_version;
- $beta_version = beta_version;
+ if (defined('beta_version')) $beta_version = beta_version;
?>

<h2><?=$pageTitle?></h2>
=======================================
--- /website/trunk/htdocs/help/faq_i18n.php Thu Jul 9 23:02:13 2015 UTC
+++ /website/trunk/htdocs/help/faq_i18n.php Mon Jul 27 23:42:04 2015 UTC
@@ -7,12 +7,12 @@
require_once "main.inc.php";
$pageId = "faq_i18n";

- if ($_REQUEST["section"])
+ if (array_key_exists('section',$_REQUEST))
$faqSectionId = $_REQUEST["section"];
else
$faqSectionId = $_REQUEST["s"];

- if ($_REQUEST["item"])
+ if (array_key_exists('item',$_REQUEST))
$itemId = $_REQUEST["item"];
else
$itemId = $_REQUEST["i"];
=======================================
--- /website/trunk/htdocs/include/header.inc.php Fri May 1 19:51:29 2015
UTC
+++ /website/trunk/htdocs/include/header.inc.php Mon Jul 27 23:42:04 2015
UTC
@@ -62,7 +62,7 @@
$titleStr = _("Audacity: Free Sound Editor and Recording Software");
$titleImg = "<img title=\"$titleStr\" alt=\"$titleStr\"
src=\"$sitePath/images/Audacity-logo-r_50pct.jpg\">";

- if ($sectionId == "" && $pageId == "") {
+ if (isset($sectionId) && isset($pageId) && $sectionId == "" && $pageId
== "") {
echo "<h1>$titleImg</h1>";
}
else {
@@ -97,7 +97,7 @@
</div>

<?php
- if ($sectionNavItems) {
+ if (isset($sectionNavItems) && $sectionNavItems<>0) {
?>

<div id="leftcolumn">
@@ -154,7 +154,7 @@
}

if ($selected) {
- ?><li <?=$li_class?>><?=$indent?><?=$name?></li><?php
+ ?><li <?=$li_class?>><?=$indented?><?=$name?></li><?php
}
else {
?><li <?=$li_class?>><a
href="<?=$sectionPath?>/<?=$path?>"><?=$name?></a></li><?php
@@ -208,4 +208,4 @@
}
?>

-<div id="content"<?php if ($sectionNavItems) echo ' class="afternav"';?>>
+<div id="content"<?php if (isset($sectionNavItems)) echo '
class="afternav"';?>>
=======================================
--- /website/trunk/htdocs/include/lang.inc.php Sat May 2 21:57:05 2015 UTC
+++ /website/trunk/htdocs/include/lang.inc.php Mon Jul 27 23:42:04 2015 UTC
@@ -88,8 +88,8 @@
// Return the explicitly requested language, if available.
function get_requested_lang() {
global $cookie_days;
- $result = $_COOKIE["lang"];
- if ($_GET["lang"]) {
+ $result = array_key_exists('lang', $_COOKIE) ? $_COOKIE["lang"] : "en";
+ if (array_key_exists('lang',$_GET)) {
$result = $_GET["lang"];
setcookie("lang", $result, time() + $cookie_days*24*60*60, "/");
}
Reply all
Reply to author
Forward
0 new messages