What returns one?

I did a check on the site directory, but if the directory does not match, one is returned from somewhere.

<?
global $APPLICATION;
if($APPLICATION->GetCurPage(false)==SITE_DIR."service/" ||
$APPLICATION->GetCurPage(false)==SITE_DIR."price/" ||
$APPLICATION->GetCurPage(false)==SITE_DIR."contacts/" || 
$APPLICATION->GetCurPage(false)==SITE_DIR."about/" || 
$APPLICATION->GetCurPage(false)==SITE_DIR."news/" || 
$APPLICATION->GetCurPage(false)==SITE_DIR."hot_deals/" || 
$APPLICATION->GetCurPage(false)==SITE_DIR."price/" || 
$APPLICATION->GetCurPage(false)==SITE_DIR."professional_tips/" || 
$APPLICATION->GetCurPage(false)==SITE_DIR."facts/" || 
$APPLICATION->GetCurPage(false)==SITE_DIR."sitemap/" || 
$APPLICATION->GetCurPage(false)==SITE_DIR."order_call/" || 
$APPLICATION->GetCurPage(false)==SITE_DIR."subscribe/"
)
{ 
} else {
if(empty($arResult))
    return " ";
$strReturn = '<nav>';
for($index = 0, $itemSize = count($arResult); $index < $itemSize; $index++)
{
    if($index > 0)
        $strReturn .= '&nbsp;>&nbsp;';
    $title = htmlspecialcharsex($arResult[$index]["TITLE"]);
    if($arResult[$index]["LINK"] <> "")
        $strReturn .= '<a href="'.$arResult[$index]["LINK"].'" title="'.$title.'">'.$title.'</a>';
    else
        $strReturn .= '<a href="'.$arResult[$index]["LINK"].'" title="'.$title.'">'.$title.'</a>';
}
$strReturn .= '</nav>';
return $strReturn;
}
?>

Can you tell me what returns one?


Answer 1, authority 100%

Probably somewhere in your code, you have a line like (Example #5 include() and the return() statement
):

$bar = include 'noreturn.php';
echo $bar; // prints 1

$bar is the value 1 because the include was successful. Notice the difference between the above examples. The first uses return() within the included file while the other does not. If the file can’t be included, FALSE is returned and E_WARNING is issued.


Answer 2, authority 100%

Check the line where you have this component connected. You probably have an extra echo there, something like this:

echo $APPLICATION->IncludeComponent(...

And it should be like this:

$APPLICATION->IncludeComponent(...

Answer 3

Horror-horror-horror. Try rewriting the first part like this:

$dir = explode('/', $APPLICATION->GetCurDir());
$dir = $dir[sizeof($dir)-2];
if($dir == 'service' || $dir == 'price'){ //  ..,     
    // 
}

And add global $arResult;. Look, it’s empty.