Missing single '\' in call via folder.php

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
DTE-Admin
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Oct 28, 2015 5:46 pm

Missing single '\' in call via folder.php

Post by DTE-Admin » Wed Oct 28, 2015 6:23 pm

I had issues installing Joomla 3.4.3 then stably updating to 3.4.4... After a week of struggling with that it dawned on me to simply download the 3.4.4. Full Install, and success!

• No more JFolder errors, Extensions loaded successfully and updated without issues

• C:\Windows\Temp<writable> on my 2012 R2 Standard VM running IIS 8.5 with PHP 5.6.11(x64) and MySQL 5.6; Now running Joomla 3.4.5 (excitedly awaiting 3.5 in Dec!)

• Temp and Log folders were writable provided the configuration.php file uses the total UNC for its dynamic $tmp and $logs variables.

HOWEVER!!!

The php.ini literally holds a loaded 9mm to my head, and forces me to double quote the UNC "\\SERVER\RAID\inetpub\wwwroot\site1(of5)"; ANY attempt to try simply "tmp" or "/tmp" in the Global Config renders the System Info->Folder Permissions->Logs & temp both unwritable upon refresh.

Earlier in life, the C:\Windows\Temp ON MY VM was unwritable to IIS_IUSRS and this was rectified. My inetpub has been successfully transferred to a RAID5 with a mighty FTP and everything running relatively smooth.

Each Virtual hostname has their own applicationPool, each site uses the single 64-bit PHP installation with their own MySQL database, and each have a separate folder for their respective Joomla install.

Funny thing too, when I 1st installed the OS on this VM, it was '12 R2 Datacenter and we had no issues til IIS crashed from FTP permission config versus a browser hijacker (!?!). We then stepped it down to Standard Custom Install, and had a handful of Visual C+ Redistribution nightmares galore (Even if u run 64 bit PHP, Please be wise and install both address versions(x86 AND x64))

Ok so with the 3.4.4 running solid, the FTP working without issue etc. I overlaid the T3 framework to install Purity III on each of my websites. My intention is to comfortably configure one site then conform each using the same nice, free responsive template. I am eager to further my PHP and CSS and XML development so I don't mind learning methods of "hands on approach" to this code.

I would go into this Menu selection called ThemeMagic where one may alter the code for the Purity III template. ThemeMagic would only load a halfway load bar, and you could neither select the included RED and ORANGE themes (Which would have been an invaluable asset to discern three different sites to be developed... Blue/Red/Orange until they each become a more independent form) Purity III would JFOLDER error when you entered its config area and the issue was it only saw an escaped single back slash so it failed the call to the UNC as it needed '\\' but only received '\' I changed the template back to protostar and the error repeated itself and I traced it to \libraries\joomla\filesystem\FOLDER.PHP specifically (around line 510):

Code: Select all

	public static function files($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
		$excludefilter = array('^\..*', '.*~'), $naturalSort = false)
	{
		// Check to make sure the path valid and clean
		$pathObject = new JFilesystemWrapperPath;
		$path = $pathObject->clean($path);
		
		// Is the path a folder?
			if (!is_dir($path))
		{
			JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FILES', $path), JLog::WARNING, 'jerror');

			return false;
		}
[...]
	}
Ive tried to grab $path and addslash()/stripslash() and the JFOLDER error persists (the JFOLDER error persists within the code of the joomla framework and is not a template based issue, and this is proved as it corrupts all templates)...

What do I need to do to simply make $path "\\SERVER\RAID\inetpub\wwwroot\sitename" prior to it being passed to the function so it fixes the call, and saves my bacon?

I am seeking help in the logical stepping of "Get path, count the # of chars in the string, add a '\' to the front because something is parsing it off, then pass it to that files function correctly"

Any input is appreciated, any non divulged systemic information stands ready to be discussed. With great thanks!

mbabker
Joomla! Hero
Joomla! Hero
Posts: 2220
Joined: Sun Feb 28, 2010 8:26 pm

Re: Missing single '\' in call via folder.php

Post by mbabker » Wed Oct 28, 2015 7:10 pm

Look at the return value from JPath::clean (https://github.com/joomla/joomla-cms/bl ... h.php#L194). What is being injected into it and what is being returned?

DTE-Admin
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Oct 28, 2015 5:46 pm

Re: Missing single '\' in call via folder.php

Post by DTE-Admin » Wed Oct 28, 2015 7:39 pm

I threw an ECHO in there and have this coming out

" Your path after CLEAN executes is \\SERVER\RAID\inetpub\wwwroot\site name\components\com_jce\editor\tiny_mce\plugins."

From a more specific alteration:

Code: Select all

/**
	 * Function to strip additional / or \ in a path name.
	 *
	 * @param   string  $path  The path to clean.
	 * @param   string  $ds    Directory separator (optional).
	 *
	 * @return  string  The cleaned path.
	 *
	 * @since   11.1
	 * @throws  UnexpectedValueException
	 */
	public static function clean($path, $ds = DIRECTORY_SEPARATOR)
	{
		if (!is_string($path) && !empty($path))
		{
			throw new UnexpectedValueException('JPath::clean: $path is not a string.');
		}

		$path = trim($path);

		if (empty($path))
		{
			$path = JPATH_ROOT;
		}
		// Remove double slashes and backslashes and convert all slashes and backslashes to DIRECTORY_SEPARATOR
		// If dealing with a UNC path don't forget to prepend the path with a backslash.
		elseif (($ds == '\\') && ($path[0] == '\\' ) && ( $path[1] == '\\' ))
		{
			$path = "\\" . preg_replace('#[/\\\\]+#', $ds, $path);
			
		}
		else
		{
			$path = preg_replace('#[/\\\\]+#', $ds, $path);
		}
		echo "Your path after CLEAN executes is $path. \n";
		return $path;

	}
When this passes the UNC I think it needs to pass THREE slashes and allow one to be parsed in the Static FILES function(?)

mbabker
Joomla! Hero
Joomla! Hero
Posts: 2220
Joined: Sun Feb 28, 2010 8:26 pm

Re: Missing single '\' in call via folder.php

Post by mbabker » Wed Oct 28, 2015 8:25 pm

Not sure I'm totally following what error you're getting, but it looks like either the is_dir() check after the path is cleaned is failing (which would be something in PHP core, not Joomla) or it's getting past that and there's some issue with JFolder::_items() and parsing that path. I don't think adding a third slash to the base of that is going to change things just at a first glance and checking a couple of Google searches.

DTE-Admin
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Oct 28, 2015 5:46 pm

Re: Missing single '\' in call via folder.php

Post by DTE-Admin » Wed Oct 28, 2015 8:52 pm

Ok so from the JOOMLA side (and I am not ruling out a wacky PHP either, just yet.)

I can click Extension -> Modules -> New -> Custom HTML and begin to set up the module.

I name the module "Logo" and then go below the WYSIWYG box of JCE (all up to date extensions etc)

There is a choice of Either ARTICLE or IMAGE. When I Click IMAGE to address the media manager I get the correct folders etc but at the top fo the pop up is:

'Warning
JFolder: :folder: Path is not a folder. Path: \SERVER\RAID\inetpub\wwwroot\site name\images'

The parsed '\' on '\SERVER\RAID...' should actually be '\\SERVER\RAID\inetpub\wwwroot\site name...\

So Somewhere between CLEAN and FILES processing, I'm losing a '\'

I am happy to further pursue at your leisure


Locked

Return to “Joomla! 3.x Bug Reporting”