baseurlappender

There's small problem:

<a href="#">link</a>

baseUrl should not be added in the above example, but it is.

This can be fixed changing the following:

BaseUrlAppender.php



'/<(a|link)(.*?)href=["'](?!http|mailto|javascript|ftp:)(?!'.preg_quote($baseurl, '/').')(.*?)["'](.*?)>/',





/************* to ****************/





'/<(a|link)(.*?)href=["'](?!http|mailto|javascript|ftp:)(?!'.preg_quote($baseurl, '/').')([^#]*?)["'](.*?)>/',


CBaseLinkViewRenderer.php:



'/<(a|link)(.*?)href=["'](?!http|mailto|javascript|ftp:)(.*?)["'](.*?)>/',





/************* to ****************/





'/<(a|link)(.*?)href=["'](?!http|mailto|javascript|ftp:)([^#]*?)["'](.*?)>/',


I found this problem while trying to use Yii Tab Widget.

It does not work with ClientScript’s registerCssFile() nor registerJsFile(). My solution was to instead of using this widget in the main layout use it in the base controller processOutput() method. Obviously for this you do need to extend your controllers from Controller instead of from CController.




class Controller extends CController {

	

        (...)


	public function processOutput($output) {

		$output = parent::processOutput($output);

		ob_start();

		ob_implicit_flush(false);

		$this->beginWidget('application.extensions.BaseUrlAppender');

		echo $output;

		$this->endWidget();

		$output = ob_get_clean();

		return $output;

	}

}