Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 490

Show
Ignore:
Timestamp:
07/20/05 15:10:13
Author:
peterhunt
Message:

fix to cptools that made index() work in corner cases, and fixed a security flaw.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/cptools.py

    r465 r490  
    103103        if len(args) == 0: 
    104104            args = ("index",) 
    105         if hasattr( self, args[ 0 ] ): 
    106             return getattr( self, args[ 0 ] )( *args[ 1: ], **kwargs ) 
     105        m = getattr(self, args[0], None) 
     106        if m and getattr(m, "exposed", False): 
     107            return getattr(self, args[0])(*args[1:], **kwargs) 
    107108        else: 
     109            m = getattr(self, "index", None) 
     110            if m and getattr(m, "exposed", False): 
     111                return self.index(*args, **kwargs) 
    108112            raise cherrypy.NotFound, cherrypy.request.path 
    109113    default.exposed = True 

Hosted by WebFaction

Log in as guest/cpguest to create tickets