HomeHelpTrac

Ignore:
Timestamp:
10/20/09 19:42:05 (3 years ago)
Author:
Alexander Trofimov
Message:

Ticket #1340

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc/BxDolXMLRPCMedia.php

    r11465 r12990  
    99        $iIdProfile = BxDolXMLRPCUtil::getIdByNickname ($sNick); 
    1010        if (!$iIdProfile || !($iId = BxDolXMLRPCUtil::checkLogin ($sUser, $sPwd))) 
    11             return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 
     11            return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct"));         
    1212 
    1313        return BxDolXMLRPCMedia::_getFilesInCategory ('videos', $iIdProfile, $sCat, 'video', 'getToken', 'flash/modules/video/files/get_mobile.php?id='); 
     
    2424 
    2525    function _getFilesInCategory ($sModuleName, $iIdProfile, $sCat, $sWidget = '', $sFuncToken = '', $sTokenUrl = '') 
    26     {      
    27         if ($sWidget) { 
     26    {    
     27        if ($sWidget && preg_match('/[a-zA-Z0-9]+/', $sWidget)) { 
    2828            $GLOBALS['sModule'] = $sWidget; 
    2929            require_once (BX_DIRECTORY_PATH_ROOT . "flash/modules/{$sWidget}/inc/header.inc.php"); 
    30         } 
    31          
    32         $a = BxDolService::call ($sModuleName, 'get_files_in_cat', array($iIdProfile, $sCat), 'Search'); 
     30        } else { 
     31            $sWidget = ''; 
     32        } 
     33 
     34        $sCat = process_db_input($sCat, BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION); 
     35 
     36        $a = BxDolService::call ($sModuleName, 'get_files_in_cat', array((int)$iIdProfile, $sCat), 'Search'); 
    3337        if (!$a) 
    3438            return new xmlrpcval (array(), "array"); 
     
    7983    function _getMediaCategories ($sType, $iIdProfile) 
    8084    { 
     85        $iIdProfile = (int)$iIdProfile; 
    8186        switch ($sType) { 
    8287            case 'photo': 
     
    158163        } 
    159164        bx_import('BxDolAlbums'); 
    160         $o = new BxDolAlbums ($sType, $iIdProfile); 
    161         $aList = $o->getAlbumList (array('owner' => $iIdProfile)); 
     165        $o = new BxDolAlbums ($sType, (int)$iIdProfile); 
     166        $aList = $o->getAlbumList (array('owner' => (int)$iIdProfile)); 
    162167        $aXmlRpc = array (); 
    163168        foreach ($aList as $r) 
     
    195200    function _getFilesInAlbum ($sModuleName, $iIdProfile, $iAlbumId, $sWidget = '', $sFuncToken = '', $sTokenUrl = '') 
    196201    {      
    197         if ($sWidget) { 
     202        if ($sWidget && preg_match('/[a-zA-Z0-9]+/', $sWidget)) { 
    198203            require_once (BX_DIRECTORY_PATH_ROOT . "flash/modules/global/inc/db.inc.php"); 
    199204            require_once (BX_DIRECTORY_PATH_ROOT . "flash/modules/{$sWidget}/inc/header.inc.php"); 
     
    202207        } 
    203208 
    204         $a = BxDolService::call ($sModuleName, 'get_files_in_album', array($iAlbumId), 'Search'); 
     209        $a = BxDolService::call ($sModuleName, 'get_files_in_album', array((int)$iAlbumId), 'Search'); 
    205210        if (!$a) 
    206211            return new xmlrpcval (array(), "array"); 
     
    227232        } 
    228233        return new xmlrpcval ($aFiles, "array"); 
    229     }     
     234    } 
    230235} 
    231236 
Note: See TracChangeset for help on using the changeset viewer.