TUCoPS :: Web :: PHP :: bt201.txt

EzPublish Directory XSS Vulnerability


------=_NextPart_000_0048_01C31B73.81928CC0
Content-Type: text/plain;
	charset="iso-8859-9"
Content-Transfer-Encoding: 7bit

------------------------------------------------------
EzPublish "Directory" XSS Vulnerability
------------------------------------------------------

------------------------------------------------------
About Ezpublish;
------------------------------------------------------
PHP Based Content Management System
Vendor : http://ez.no
Demo : http://publishdemo.ez.no/

------------------------------------------------------
Vulnerable;
------------------------------------------------------
eZ publish 2.2

------------------------------------------------------
Not Vulnerable;
------------------------------------------------------
eZ publish 3

------------------------------------------------------
Vendor Status;
------------------------------------------------------
Vendor replied and send a new version of this file. (attached)

------------------------------------------------------
Patch;
------------------------------------------------------
You can download patched file in attachment.

------------------------------------------------------
Exploit;
------------------------------------------------------
http://[victim]/index.php/article/articleview/[img%20src="javascript:alert(document.cookie)"]

(Replace [], <>)


Ferruh Mavituna
Web Application Security Consultant
Freelance Developer & Designer
http://ferruh.mavituna.com
ferruh@mavituna.com

------=_NextPart_000_0048_01C31B73.81928CC0
Content-Type: application/octet-stream;
	name="articleview.php"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="articleview.php"

<?php=0A=
// =0A=
// $Id: articleview.php,v 1.84.2.15 2003/05/15 16:25:19 br Exp $=0A=
//=0A=
// Created on: <18-Oct-2000 16:34:51 bf>=0A=
//=0A=
// This source file is part of eZ publish, publishing software.=0A=
//=0A=
// Copyright (C) 1999-2001 eZ Systems.  All rights reserved.=0A=
//=0A=
// This program is free software; you can redistribute it and/or=0A=
// modify it under the terms of the GNU General Public License=0A=
// as published by the Free Software Foundation; either version 2=0A=
// of the License, or (at your option) any later version.=0A=
//=0A=
// This program is distributed in the hope that it will be useful,=0A=
// but WITHOUT ANY WARRANTY; without even the implied warranty of=0A=
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the=0A=
// GNU General Public License for more details.=0A=
//=0A=
// You should have received a copy of the GNU General Public License=0A=
// along with this program; if not, write to the Free Software=0A=
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  =
02111-1307, US=0A=
//=0A=
=0A=
include_once( "classes/ezhttptool.php" );=0A=
include_once( "classes/INIFile.php" );=0A=
include_once( "classes/eztemplate.php" );=0A=
include_once( "classes/ezlocale.php" );=0A=
=0A=
include_once( "ezarticle/classes/ezarticlecategory.php" );=0A=
include_once( "ezarticle/classes/ezarticle.php" );=0A=
include_once( "ezarticle/classes/ezarticlerenderer.php" );=0A=
include_once( "ezmail/classes/ezmail.php" );=0A=
include_once( "ezsitemanager/classes/ezsection.php" );=0A=
=0A=
$ini =3D& INIFile::globalINI();=0A=
=0A=
$Language =3D $ini->read_var( "eZArticleMain", "Language" );=0A=
$ForceCategoryDefinition =3D $ini->read_var( "eZArticleMain", =
"ForceCategoryDefinition" );=0A=
$CapitalizeHeadlines =3D $ini->read_var( "eZArticleMain", =
"CapitalizeHeadlines" );=0A=
$TemplateDir =3D $ini->read_var( "eZArticleMain", "TemplateDir" );=0A=
$ListImageWidth =3D $ini->read_var( "eZArticleMain", "ListImageWidth" );=0A=
$ListImageHeight =3D $ini->read_var( "eZArticleMain", "ListImageHeight" =
);=0A=
=0A=
if ( !is_numeric( $ArticleID ) )=0A=
{=0A=
    eZHTTPTool::header( "Location: /error/404" );=0A=
    exit();=0A=
}=0A=
=0A=
if ( !is_numeric( $PageNumber) )=0A=
    $PageNumber =3D "";=0A=
=0A=
if ( !is_numeric( $CategoryID ) )=0A=
    $CategoryID =3D eZArticle::categoryDefinitionStatic( $ArticleID );=0A=
=0A=
=0A=
if ( $ForceCategoryDefinition =3D=3D "enabled" )=0A=
{=0A=
    $CategoryID =3D eZArticle::categoryDefinitionStatic( $ArticleID );=0A=
}=0A=
=0A=
$GlobalSectionID =3D eZArticleCategory::sectionIDStatic( $CategoryID );=0A=
=0A=
// init the section=0A=
$sectionObject =3D& eZSection::globalSectionObject( $GlobalSectionID );=0A=
$sectionObject->setOverrideVariables();=0A=
=0A=
=0A=
$t =3D new eZTemplate( "ezarticle/user/" . $TemplateDir,=0A=
                     "ezarticle/user/intl/", $Language, =
"articleview.php" );=0A=
=0A=
$t->setAllStrings();=0A=
=0A=
$StaticPage =3D false;=0A=
if ( $url_array[2] =3D=3D "static" || $url_array[2] =3D=3D =
"articlestatic"  )=0A=
{=0A=
    $StaticPage =3D true;=0A=
}=0A=
=0A=
=0A=
// override template for the current category=0A=
$override =3D "_override_$CategoryID";=0A=
// override template for current section=0A=
// category override will be prefered=0A=
$sectionOverride =3D "_sectionoverride_$GlobalSectionID";=0A=
=0A=
if ( $StaticPage =3D=3D true )=0A=
{=0A=
    if ( eZFile::file_exists( =
"ezarticle/user/$TemplateDir/articlestatic" . $override  . ".tpl" ) )=0A=
        $t->set_file( "article_view_page_tpl", "articlestatic" . =
$override  . ".tpl"  );=0A=
    else=0A=
        $t->set_file( "article_view_page_tpl", "articlestatic.tpl"  );=0A=
}=0A=
else=0A=
{=0A=
    if ( isset( $PrintableVersion ) and $PrintableVersion =3D=3D =
"enabled" )=0A=
    {=0A=
            $t->set_file( "article_view_page_tpl", "articleprint.tpl"  );=0A=
    }=0A=
    else=0A=
    {=0A=
        // category override=0A=
        if ( eZFile::file_exists( =
"ezarticle/user/$TemplateDir/articleview" . $override  . ".tpl" ) )=0A=
        {=0A=
            $t->set_file( "article_view_page_tpl", "articleview" . =
$override  . ".tpl"  );=0A=
        }=0A=
        else=0A=
        {=0A=
            // section override=0A=
            if ( eZFile::file_exists( =
"ezarticle/user/$TemplateDir/articleview" . $sectionOverride  . ".tpl" ) =
)=0A=
            {=0A=
                $t->set_file( "article_view_page_tpl", "articleview" . =
$sectionOverride  . ".tpl"  );=0A=
            }=0A=
            else=0A=
            {=0A=
                $t->set_file( "article_view_page_tpl", "articleview.tpl" =
 );=0A=
            }=0A=
        }=0A=
    }=0A=
}=0A=
=0A=
// path=0A=
$t->set_block( "article_view_page_tpl", "path_item_tpl", "path_item" );=0A=
=0A=
$t->set_block( "article_view_page_tpl", "article_url_item_tpl", =
"article_url_item" );=0A=
=0A=
$t->set_block( "article_view_page_tpl", "article_header_tpl", =
"article_header" );=0A=
$t->set_block( "article_view_page_tpl", "article_topic_tpl", =
"article_topic" );=0A=
$t->set_block( "article_view_page_tpl", "article_intro_tpl", =
"article_intro" );=0A=
=0A=
$t->set_block( "article_view_page_tpl", "attached_file_list_tpl", =
"attached_file_list" );=0A=
$t->set_block( "attached_file_list_tpl", "attached_file_tpl", =
"attached_file" );=0A=
=0A=
$t->set_block( "article_view_page_tpl", "image_list_tpl", "image_list" );=0A=
$t->set_block( "image_list_tpl", "image_tpl", "image" );=0A=
=0A=
// current category image=0A=
$t->set_block( "article_view_page_tpl", =
"current_category_image_item_tpl", "current_category_image_item" );=0A=
=0A=
$t->set_block( "article_view_page_tpl", "page_link_tpl", "page_link" );=0A=
$t->set_block( "article_view_page_tpl", "current_page_link_tpl", =
"current_page_link" );=0A=
$t->set_block( "article_view_page_tpl", "next_page_link_tpl", =
"next_page_link" );=0A=
$t->set_block( "article_view_page_tpl", "prev_page_link_tpl", =
"prev_page_link" );=0A=
$t->set_block( "article_view_page_tpl", "numbered_page_link_tpl", =
"numbered_page_link" );=0A=
$t->set_block( "article_view_page_tpl", "print_page_link_tpl", =
"print_page_link" );=0A=
=0A=
$t->set_block( "article_view_page_tpl", "mail_to_tpl", "mail_to" );=0A=
$t->set_block( "article_view_page_tpl", "attribute_list_tpl", =
"attribute_list" );=0A=
$t->set_block( "attribute_list_tpl", "type_item_tpl", "type_item" );=0A=
$t->set_block( "type_item_tpl", "attribute_item_tpl", "attribute_item" );=0A=
=0A=
=0A=
// read user override variables for image size=0A=
$ListImageWidth =3D $ini->read_var( "eZArticleMain", "ListImageWidth" );=0A=
$ListImageHeight =3D $ini->read_var( "eZArticleMain", "ListImageHeight" =
);=0A=
=0A=
// Make the manual keywords available in the articleview template=0A=
$ManualKeywords =3D& $article->manualKeywords();=0A=
$t->set_var( "article_keywords", $ManualKeywords );=0A=
=0A=
=0A=
$listImageWidthOverride =3D& $t->get_user_variable( =
"article_view_page_tpl",  "ListImageWidth" );=0A=
if ( $listImageWidthOverride )=0A=
{=0A=
    $ListImageWidth =3D $listImageWidthOverride;=0A=
}=0A=
=0A=
$listImageHeightOverride =3D& $t->get_user_variable( =
"article_view_page_tpl",  "ListImageHeight" );=0A=
if ( $listImageHeightOverride )=0A=
{=0A=
    $ListImageHeight =3D $listImageHeightOverride;=0A=
}=0A=
=0A=
=0A=
$SiteURL =3D $ini->read_var( "site", "SiteURL" );=0A=
=0A=
$t->set_var( "article_url", $SiteURL . $REQUEST_URI );=0A=
$t->set_var( "article_url_item", "" );=0A=
if ( isset( $PrintableVersion ) and $PrintableVersion =3D=3D "enabled" )=0A=
    $t->parse( "article_url_item", "article_url_item_tpl" );=0A=
=0A=
=0A=
// makes the section ID available in articleview template=0A=
$t->set_var( "section_id", $GlobalSectionID );=0A=
=0A=
$article =3D new eZArticle(  );=0A=
=0A=
// check if the article exists=0A=
if ( $article->get( $ArticleID ) )=0A=
{=0A=
    if ( $article->isPublished() )=0A=
    {=0A=
        // published article.=0A=
    }=0A=
    else=0A=
    {=0A=
        eZHTTPTool::header( "Location: /error/404" );=0A=
        exit();=0A=
    }=0A=
=0A=
    $categories =3D& $article->categories( false );=0A=
=0A=
    // path=0A=
    if ( !in_array( $CategoryID, $categories ) )=0A=
    {=0A=
        $category =3D $article->categoryDefinition();=0A=
    }=0A=
    else=0A=
    {    =0A=
        $category =3D new eZArticleCategory( $CategoryID );=0A=
    }=0A=
=0A=
    // current category image=0A=
    $image =3D& $category->image();=0A=
=0A=
    $t->set_var( "current_category_image_item", "" );=0A=
        =0A=
    if ( ( get_class( $image ) =3D=3D "ezimage" ) && ( $image->id() !=3D =
0 ) )=0A=
    {=0A=
        $imageWidth =3D& $ini->read_var( "eZArticleMain", =
"CategoryImageWidth" );=0A=
        $imageHeight =3D& $ini->read_var( "eZArticleMain", =
"CategoryImageHeight" );=0A=
=0A=
        $variation =3D& $image->requestImageVariation( $imageWidth, =
$imageHeight );=0A=
=0A=
        $imageURL =3D "/" . $variation->imagePath();=0A=
        $imageWidth =3D& $variation->width();=0A=
        $imageHeight =3D& $variation->height();=0A=
        $imageCaption =3D& $image->caption();=0A=
            =0A=
        $t->set_var( "current_category_image_width", $imageWidth );=0A=
        $t->set_var( "current_category_image_height", $imageHeight );=0A=
        $t->set_var( "current_category_image_url", $imageURL );=0A=
        $t->set_var( "current_category_image_caption", $imageCaption );=0A=
        $t->parse( "current_category_image_item", =
"current_category_image_item_tpl" );=0A=
    }=0A=
    else=0A=
    {=0A=
        $t->set_var( "current_category_image_item", "" );=0A=
    }=0A=
    =0A=
    $pathArray =3D& $category->path();=0A=
    =0A=
    $t->set_var( "path_item", "" );=0A=
    foreach ( $pathArray as $path )=0A=
    {=0A=
        $t->set_var( "category_id", $path[0] );=0A=
        =0A=
        if ( $CapitalizeHeadlines =3D=3D "enabled" )=0A=
        {=0A=
            include_once( "classes/eztexttool.php" );=0A=
            $t->set_var( "category_name", eZTextTool::capitalize(  =
$path[1] ) );=0A=
        }=0A=
        else=0A=
        {=0A=
            $t->set_var( "category_name", $path[1] );=0A=
        }=0A=
        =0A=
        $t->parse( "path_item", "path_item_tpl", true );=0A=
    }=0A=
    =0A=
    =0A=
    $renderer =3D new eZArticleRenderer( $article );=0A=
=0A=
    if ( $CapitalizeHeadlines =3D=3D "enabled" )=0A=
    {=0A=
        include_once( "classes/eztexttool.php" );=0A=
        $t->set_var( "article_name", eZTextTool::capitalize(  =
$article->name() ) );=0A=
    }=0A=
    else=0A=
    {=0A=
        $t->set_var( "article_name", $article->name() );=0A=
    }=0A=
=0A=
    if ( eZMail::validate( $article->authorEmail() ) && =
$article->authorEmail() )=0A=
    {=0A=
        $t->set_var( "author_email", $article->authorEmail() );=0A=
    }=0A=
    else=0A=
    {=0A=
        $author =3D $article->author();=0A=
        $t->set_var( "author_email", $author->email() );=0A=
    }=0A=
    =0A=
    $t->set_var( "author_text", $article->authorText() );=0A=
    $t->set_var( "author_id", $article->contentsWriter( false ) );=0A=
=0A=
    // check for topic=0A=
    $topic =3D& $article->topic();=0A=
=0A=
    if ( get_class( $topic ) =3D=3D "eztopic" && $topic->name() !=3D "" )=0A=
    {=0A=
        $t->set_var( "topic_id", $topic->id() );=0A=
        $t->set_var( "topic_name", $topic->name() );=0A=
        $t->parse( "article_topic", "article_topic_tpl" );=0A=
    }=0A=
    else=0A=
    {=0A=
        $t->set_var( "article_topic", "" );        =0A=
    }=0A=
=0A=
    // check if author is "" or starts with -=0A=
    $authorText =3D trim( $article->authorText() );=0A=
    if ( $authorText =3D=3D "" ||=0A=
         $authorText[0] =3D=3D "-"         =0A=
         )=0A=
    {=0A=
        $ShowHeader =3D "hide";        =0A=
    }=0A=
=0A=
    =0A=
    $categoryDef =3D& $article->categoryDefinition();=0A=
=0A=
    $t->set_var( "category_definition_name", $categoryDef->name() );=0A=
=0A=
    $pageCount =3D $article->pageCount();=0A=
    if ( $PageNumber > $pageCount )=0A=
        $PageNumber =3D $pageCount;=0A=
=0A=
    if ( $PageNumber =3D=3D -1 )=0A=
        $articleContents =3D $renderer->renderPage( -1 );=0A=
    else=0A=
        $articleContents =3D $renderer->renderPage( $PageNumber -1 );=0A=
    =0A=
    $t->set_var( "article_intro", $articleContents[0] );=0A=
=0A=
    if ( ( $PageNumber =3D=3D 1 ) || (( isset( $PrintableVersion ) and =
$PrintableVersion =3D=3D "enabled" )))=0A=
           $t->parse( "article_intro", "article_intro_tpl" );=0A=
    else=0A=
        $t->set_var( "article_intro", "" );=0A=
        =0A=
    $t->set_var( "article_body", $articleContents[1] );=0A=
=0A=
    $t->set_var( "link_text", $article->linkText() );=0A=
=0A=
    $t->set_var( "article_id", $article->id() );=0A=
=0A=
    $locale =3D new eZLocale( $Language );=0A=
    $published =3D $article->published();=0A=
=0A=
    $publishedDateValue =3D& $published->date();=0A=
    $publishedTimeValue =3D& $published->time();=0A=
=0A=
    $t->set_var( "article_datevalue", $locale->format( =
$publishedDateValue ) );=0A=
    $t->set_var( "article_timevalue", $locale->format( =
$publishedTimeValue ) );=0A=
=0A=
    $t->set_var( "article_created", $locale->format( $published ) );=0A=
=0A=
    // image list=0A=
=0A=
    $usedImages =3D $renderer->usedImageList();=0A=
    $images =3D& $article->images();=0A=
    =0A=
    {=0A=
        $i=3D0;=0A=
        foreach ( $images as $imageArray )=0A=
        {=0A=
            $image =3D $imageArray["Image"];=0A=
            $placement =3D $imageArray["Placement"];=0A=
=0A=
            $showImage =3D true;=0A=
=0A=
            if ( is_array( $usedImages ) =3D=3D true )=0A=
            {=0A=
                if ( in_array( $placement, $usedImages ) )=0A=
                {=0A=
                    $showImage =3D false;=0A=
                }=0A=
            }=0A=
            =0A=
            if (  $showImage  )=0A=
            {=0A=
                if ( ( $i % 2 ) =3D=3D 0 )=0A=
                {=0A=
                    $t->set_var( "td_class", "bglight" );=0A=
                }=0A=
                else=0A=
                {=0A=
                    $t->set_var( "td_class", "bgdark" );=0A=
                }=0A=
=0A=
                if ( $image->caption() =3D=3D "" )=0A=
                    $t->set_var( "image_caption", "&nbsp;" );=0A=
                else=0A=
                    $t->set_var( "image_caption", $image->caption() );=0A=
=0A=
            =0A=
                $t->set_var( "image_id", $image->id() );=0A=
                $t->set_var( "article_id", $ArticleID );=0A=
=0A=
                $variation =3D& $image->requestImageVariation( =
$ListImageWidth, $ListImageHeight );=0A=
=0A=
                $t->set_var( "image_url", "/" .$variation->imagePath() );=0A=
                $t->set_var( "image_width", $variation->width() );=0A=
                $t->set_var( "image_height",$variation->height() );=0A=
=0A=
                $t->parse( "image", "image_tpl", true );=0A=
                $i++;=0A=
            }=0A=
            $imageNumber++;=0A=
        }=0A=
=0A=
        $t->parse( "image_list", "image_list_tpl", true );=0A=
    }=0A=
    if ( $i =3D=3D 0 )=0A=
        $t->set_var( "image_list", "" );    =0A=
=0A=
    =0A=
=0A=
}=0A=
else=0A=
{=0A=
    eZHTTPTool::header( "Location: /error/404" );=0A=
    exit();=0A=
}=0A=
=0A=
=0A=
=0A=
if ( $StaticRendering =3D=3D true  || $ShowHeader =3D=3D "hide" )=0A=
{=0A=
    $t->set_var( "article_header", "" );=0A=
}=0A=
else=0A=
{=0A=
    $t->parse( "article_header", "article_header_tpl" );=0A=
}=0A=
=0A=
=0A=
// set the variables in the mail_to form=0A=
if ( !isset( $SendTo ) )=0A=
    $SendTo =3D "";=0A=
$t->set_var( "send_to", $SendTo );=0A=
if ( !isset( $From ) )=0A=
    $From =3D "";=0A=
$t->set_var( "from", $From );=0A=
=0A=
$types =3D $article->types();=0A=
=0A=
$typeCount =3D count( $types );=0A=
=0A=
$t->set_var( "attribute_item", "" );=0A=
$t->set_var( "type_item", "" );=0A=
$t->set_var( "attribute_list", "" );=0A=
=0A=
if( $typeCount > 0 )=0A=
{=0A=
    foreach( $types as $type )=0A=
    {=0A=
        $attributes =3D array();=0A=
        $attributes =3D $type->attributes();=0A=
        $attributeCount =3D count( $attributes );=0A=
        =0A=
        if( $attributeCount > 0 )=0A=
        {=0A=
            $t->set_var( "type_id", $type->id() );=0A=
            $t->set_var( "type_name", $type->name() );=0A=
            $t->set_var( "attribute_item", "" );=0A=
            foreach( $attributes as $attribute )=0A=
            {=0A=
                $t->set_var( "attribute_id", $attribute->id() );=0A=
                $t->set_var( "attribute_name", $attribute->name() );=0A=
                $t->set_var( "attribute_value", nl2br( =
$attribute->value( $article ) ) );=0A=
                $t->parse( "attribute_item", "attribute_item_tpl", true =
);=0A=
            }=0A=
            $t->parse( "type_item", "type_item_tpl", true );=0A=
        }=0A=
    }=0A=
=0A=
    $t->parse( "attribute_list", "attribute_list_tpl" );=0A=
}=0A=
=0A=
=0A=
=0A=
// files=0A=
$files =3D $article->files();=0A=
=0A=
if ( count( $files ) > 0 )=0A=
{=0A=
    $i=3D0;=0A=
    foreach ( $files as $file )=0A=
    {=0A=
        if ( ( $i % 2 ) =3D=3D 0 )=0A=
        {=0A=
            $t->set_var( "td_class", "bglight" );=0A=
        }=0A=
        else=0A=
        {=0A=
            $t->set_var( "td_class", "bgdark" );=0A=
        }=0A=
=0A=
        $t->set_var( "file_id", $file->id() );=0A=
        $t->set_var( "original_file_name", $file->originalFileName() );=0A=
        $t->set_var( "file_name", $file->name() );=0A=
        $t->set_var( "file_url", $file->name() );=0A=
        $t->set_var( "file_description", $file->description() );=0A=
=0A=
        $size =3D $file->siFileSize();=0A=
        $t->set_var( "file_size", $size["size-string"] );=0A=
        $t->set_var( "file_unit", $size["unit"] );=0A=
=0A=
=0A=
        $i++;=0A=
        $t->parse( "attached_file", "attached_file_tpl", true );=0A=
    }=0A=
=0A=
    $t->parse( "attached_file_list", "attached_file_list_tpl" );=0A=
}=0A=
else=0A=
{=0A=
    $t->set_var( "attached_file_list", "" );=0A=
}=0A=
=0A=
=0A=
$t->set_var( "current_page_link", "" );=0A=
=0A=
// page links=0A=
if ( $pageCount > 1 && $PageNumber !=3D -1 && ( $PrintableVersion !=3D =
"enabled" ) )=0A=
{=0A=
    for ( $i=3D0; $i<$pageCount; $i++ )=0A=
    {=0A=
        $t->set_var( "article_id", $article->id() );=0A=
        $t->set_var( "page_number", $i+1 );=0A=
        $t->set_var( "category_id", $CategoryID );=0A=
=0A=
        if ( ( $i + 1 )  =3D=3D $PageNumber )=0A=
        {=0A=
            $t->parse( "page_link", "current_page_link_tpl", true );=0A=
        }=0A=
        else=0A=
        {=0A=
            $t->parse( "page_link", "page_link_tpl", true );            =0A=
        }=0A=
    }=0A=
}=0A=
else=0A=
{=0A=
    $t->set_var( "page_link", "" );=0A=
    =0A=
}=0A=
=0A=
$t->set_var( "total_pages", $pageCount );=0A=
$t->set_var( "current_page", $PageNumber );=0A=
=0A=
// non-printable version link=0A=
if ( ( $PageNumber =3D=3D -1 ) && ( $PrintableVersion =3D=3D "enabled" ) =
)=0A=
{=0A=
    $t->parse( "numbered_page_link", "numbered_page_link_tpl" );=0A=
}=0A=
else=0A=
{=0A=
    $t->set_var( "numbered_page_link", "" );=0A=
}=0A=
=0A=
// printable version link=0A=
if ( ( !isset( $PrintableVersion ) or $PrintableVersion !=3D "enabled" ) =
&& ( !isset( $StaticRendering ) or $StaticRendering !=3D true )  )=0A=
{=0A=
    $t->parse( "print_page_link", "print_page_link_tpl" );=0A=
}=0A=
else=0A=
{=0A=
    $t->set_var( "print_page_link", "" );=0A=
}=0A=
=0A=
// previous page link=0A=
if ( ( $PageNumber > 1 ) && ( $PrintableVersion !=3D "enabled" ) )=0A=
{=0A=
    $t->set_var( "prev_page_number", $PageNumber - 1 );    =0A=
    $t->parse( "prev_page_link", "prev_page_link_tpl" );=0A=
}=0A=
else=0A=
{=0A=
    $t->set_var( "prev_page_link", "" );=0A=
}=0A=
=0A=
// next page link=0A=
if ( $PageNumber < $pageCount && $PageNumber !=3D -1 && ( =
$PrintableVersion !=3D "enabled" ) )=0A=
{=0A=
    $t->set_var( "next_page_number", $PageNumber + 1 );    =0A=
    $t->parse( "next_page_link", "next_page_link_tpl" );=0A=
}=0A=
else=0A=
{=0A=
    $t->set_var( "next_page_link", "" );=0A=
}=0A=
=0A=
=0A=
// set variables for meta information=0A=
$SiteTitleAppend =3D $article->name();=0A=
$SiteDescriptionOverride =3D str_replace( "\"", "", strip_tags( =
$articleContents[0] ) );=0A=
$SiteKeywordsOverride =3D str_replace( "\"", "", strip_tags( =
$article->keywords() ) );=0A=
=0A=
$SiteKeywordsOverride  =3D str_replace( "qdom", "", =
$SiteKeywordsOverride );=0A=
=0A=
if ( isset( $GenerateStaticPage ) && $GenerateStaticPage =3D=3D "true" )=0A=
{    =0A=
    $fp =3D eZFile::fopen( $cachedFile, "w+");=0A=
=0A=
    // add PHP code in the cache file to store variables=0A=
    $output =3D "<?php\n";=0A=
    $output .=3D "\$ManualKeywords=3D\"$ManualKeywords\";\n";=0A=
    $output .=3D "\$GlobalSectionID=3D\"$GlobalSectionID\";\n";=0A=
    $output .=3D "\$SiteTitleAppend=3D\"$SiteTitleAppend\";\n";=0A=
    $output .=3D =
"\$SiteDescriptionOverride=3D\"$SiteDescriptionOverride\";\n";=0A=
    $output .=3D =
"\$SiteKeywordsOverride=3D\"$SiteKeywordsOverride\";\n";    =0A=
    $output .=3D "\$eZLanguageOverride=3D\"$eZLanguageOverride\";\n";=0A=
    $output .=3D "?>\n";=0A=
=0A=
    $printOut =3D $t->parse( $target, "article_view_page_tpl" );=0A=
    =0A=
    // print the output the first time while printing the cache file.=0A=
    print( $printOut );=0A=
    =0A=
    $output .=3D $printOut;=0A=
         =0A=
    fwrite ( $fp, $output );=0A=
    fclose( $fp );=0A=
}=0A=
else=0A=
{=0A=
    $t->pparse( "output", "article_view_page_tpl" );=0A=
}=0A=
=0A=
?>=0A=

------=_NextPart_000_0048_01C31B73.81928CC0--

TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2024 AOH