Changeset 369
- Timestamp:
- 03/13/07 14:06:34 (2 years ago)
- Files:
-
- trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisProcessor.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/websites/processors/stubAbstractProcessor.php (modified) (2 diffs)
- trunk/src/main/php/net/stubbles/websites/processors/stubDefaultProcessorResolver.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/websites/xml/stubXMLProcessor.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisProcessor.php
r317 r369 37 37 protected function doProcess() 38 38 { 39 if ($this->request->hasValue('page') == true) { 40 $pageName = $this->request->getValidatedValue(new stubRegexValidator('[a-zA-Z0-9_'), 'page'); 41 if (null == $pageName || $this->pageFactory->hasPage('memphis/' . $pageName) == false) { 42 $pageName = 'index'; 43 } 44 } else { 45 $pageName = 'index'; 46 } 47 39 $pageName = $this->getPage('memphis'); 48 40 try { 49 41 $page = $this->pageFactory->getPage('memphis/' . $pageName); trunk/src/main/php/net/stubbles/websites/processors/stubAbstractProcessor.php
r315 r369 7 7 * @subpackage websites_processors 8 8 */ 9 stubClassLoader::load('net.stubbles.websites.processors.stubProcessor'); 9 stubClassLoader::load('net.stubbles.websites.processors.stubProcessor', 10 'net.stubbles.util.validators.stubRegexValidator' 11 ); 10 12 /** 11 13 * Base processor implementation. … … 82 84 return $this->response; 83 85 } 86 87 /** 88 * retrieves the page name 89 * 90 * @param string $dirPrefix directory prefix to use for page factory 91 * @return string 92 */ 93 protected function getPage($dirPrefix = null) 94 { 95 if (null != $dirPrefix) { 96 $dirPrefix .= DIRECTORY_SEPARATOR; 97 } 98 99 if ($this->request->hasValue('page') == true) { 100 $pageName = $this->request->getValidatedValue(new stubRegexValidator('([a-zA-Z0-9_])'), 'page'); 101 if (null == $pageName || $this->pageFactory->hasPage($dirPrefix . $pageName) == false) { 102 $pageName = 'index'; 103 } 104 } else { 105 $pageName = 'index'; 106 } 107 108 $this->session->putValue('net.stubbles.websites.lastPage', $pageName); 109 return $pageName; 110 } 84 111 } 85 112 ?> trunk/src/main/php/net/stubbles/websites/processors/stubDefaultProcessorResolver.php
r368 r369 114 114 } 115 115 116 $session->putValue('net.stubbles.websites.lastProcessor', $paramValue); 116 117 return $processor; 117 118 } trunk/src/main/php/net/stubbles/websites/xml/stubXMLProcessor.php
r356 r369 42 42 protected function doProcess() 43 43 { 44 if ($this->request->hasValue('page') == true) { 45 $pageName = $this->request->getValidatedValue(new stubRegexValidator('([a-zA-Z0-9_])'), 'page'); 46 if (null == $pageName || $this->pageFactory->hasPage('conf/' . $pageName) == false) { 47 $pageName = 'index'; 48 } 49 } else { 50 $pageName = 'index'; 51 } 52 44 $pageName = $this->getPage('conf'); 53 45 $xmlSerializer = $this->createXMLSerializer(); 54 46 $xmlStreamWriter = $this->createXMLStreamWriter();
