Bug #23826 ยป tslib_content.diff

Administrator Admin, 2010-10-22 16:25

View differences:

typo3/sysext/cms/tslib/class.tslib_content.php (revision )
4423 4423
			$isExecuted = array();
4424 4424
			// additional switch to make sure 'required', 'if' and 'fieldRequired'
4425 4425
			// will still stop rendering immediately in case they return false
4426
			$this->stopRendering = false;
4427 4426

  
4427
			$this->stdWrapRecursionLevel++;
4428
			$this->stopRendering[$this->stdWrapRecursionLevel] = false;
4429

  
4428 4430
			// execute each funtion in the predefined order
4429 4431
			foreach ($sortedConf as $stdWrapName => $enabled) {
4432

  
4430 4433
				// eliminate the second key of a pair 'key'|'key.' to make sure functions get called only once and check if rendering has been stopped
4431
				if (!$isExecuted[$stdWrapName] && !$this->stopRendering) {
4434
				if (!$isExecuted[$stdWrapName] && !$this->stopRendering[$this->stdWrapRecursionLevel]) {
4432 4435
					$functionName = rtrim($stdWrapName, '.');
4433 4436
					$functionProperties = $functionName . '.';
4434 4437
					// if there is any code one the next level, check if it contains "official" stdWrap functions
......
4470 4473
						);
4471 4474
					}
4472 4475
				}
4476

  
4477
				unset($this->stopRendering[$this->stdWrapRecursionLevel]);
4478
				$this->stdWrapRecursionLevel--;
4473 4479
			}
4474 4480
		}
4475 4481
		return $content;
......
4774 4780
	public function stdWrap_required($content = '', $conf = array()) {
4775 4781
		if ((string) $content == '') {
4776 4782
			$content = '';
4777
			$this->stopRendering = TRUE;
4783
			$this->stopRendering[$this->stdWrapRecursionLevel] = TRUE;
4778 4784
		}
4779 4785
		return $content;
4780 4786
	}
......
4791 4797
	public function stdWrap_if($content = '', $conf = array()) {
4792 4798
		if (!$this->checkIf($conf['if.'])) {
4793 4799
			$content = '';
4794
			$this->stopRendering = TRUE;
4800
			$this->stopRendering[$this->stdWrapRecursionLevel] = TRUE;
4795 4801
		}
4796 4802
		return $content;
4797 4803
	}
......
4808 4814
	public function stdWrap_fieldRequired($content = '', $conf = array()) {
4809 4815
		if (!trim($this->data[$conf['fieldRequired']])) {
4810 4816
			$content = '';
4811
			$this->stopRendering = TRUE;
4817
			$this->stopRendering[$this->stdWrapRecursionLevel] = TRUE;
4812 4818
		}
4813 4819
		return $content;
4814 4820
	}
    (1-1/1)