Resolved Bug


This bug has been marked as resolved.

Can not use paths with DIR_REL inside

Permalink 1 0 Browser Info Environment
DIR_REL: /cooking
URL: /cooking/index.php/tools/css/cooking/[...].css
$path (in Request object): /index.php/tools/css/[...].css

Environment is irrelevant, it affects all pages containing DIR_REL in their path. I encountered this when the theme name was the same as DIR_REL (none of the stylesheets would load).

The bug is a result of using str_replace to remove DIR_REL from the path.

The attached patch only removes DIR_REL (and DISPATCHER_FILE), only if they are at the beginning of the URL.
1 Attachment
Status: Resolved

Still Valid:

This bug is valid a newer version of concrete5. View Current Bug
AlReece45
View Replies:
andrew replied on at Permalink
andrew
Argh. Yes, this is valid. Thanks for reporting this. However I'm having a problem with your patch. When I load this into my own MAMP setup, my actual environment reports my path as "index.php" when I'm running a site without a DIR_REL. This leads my home page to render a 404 with your patch. Thoughts?
AlReece45 replied on at Permalink 1 Attachment
AlReece45
Yes, I ran into that issue today as well. It's a result with two issues of the first patch. The first being that I somehow used substr() incorrectly. The second is that the DISPATCHER_FILENAME check wasn't correct.

This revised patch has one that resolves both issues.
andrew replied on at Permalink
andrew
Hmm. I'm still having a problem. When I apply the second patch, and I visithttp://somesite.com/541/ I get a 404, and when I go tohttp://somesite.com/541/index.php/541... (my created page) I get a 404 again. This didn't happen with the previous patch - I only got a 404 when my site was at the root, I believe.
AlReece45 replied on at Permalink 1 Attachment
AlReece45
Yep, me and my lucky code. Sorry for the long wait. Here's v3 which had a bit more testing on my side. It appears to work as expected.

concrete5 Environment Information

# concrete5 Version
5.4.1RC1

# concrete5 Overrides
blocks/external_form, blocks/cooking, single_pages/register.php, single_pages/login.php, themes/cooking

# Server Software
Apache

# Server API
apache2handler

# PHP Version
5.2.11

# PHP Extensions
apache2handler, bcmath, calendar, ctype, curl, date, dba, dom, filter, ftp, gd, gettext, hash, iconv, imap, ionCube Loader, json, libxml, mbstring, mcrypt, mhash, mime_magic, mysql, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, posix, pspell, Reflection, session, SimpleXML, soap, sockets, SPL, SQLite, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlwriter, Zend Optimizer, zlib.

# PHP Settings
log_errors_max_len - 1024
max_execution_time - 5
max_input_nesting_level - 64
max_input_time - 300
memory_limit - 164M
post_max_size - 16M
safe_mode - Off
safe_mode_exec_dir -
safe_mode_gid - Off
safe_mode_include_dir -
sql.safe_mode - Off
upload_max_filesize - 100M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
pcre.backtrack_limit - 100000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
safe_mode_allowed_env_vars - PHP_
safe_mode_protected_env_vars - LD_LIBRARY_PATH

Browser User-Agent String

Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.62 Safari/534.3