Filippo Del Trappeto created SLING-2794:
-------------------------------------------

             Summary: Sling._replaceExtension() Javascript function tries to 
replace the path extension twice
                 Key: SLING-2794
                 URL: https://issues.apache.org/jira/browse/SLING-2794
             Project: Sling
          Issue Type: Bug
          Components: General
            Reporter: Filippo Del Trappeto
            Priority: Minor


The Sling._replaceExtension() Javascript function, in /system/sling.js , tries 
to replace the path extension twice, so the URL 
"http://192.168.1.2/content/blog/mypost.html"; becomes something like 
"http://192.168.1.json";, causing problems in the "46 lines blog example".

Firebug shows me:

{code}
 /** Replace extension in a path */
Sling._replaceExtension = function(path,newExtension) {
var i = path.lastIndexOf(".");
if(i >= 0) path = path.substring(0,i);
i = path.lastIndexOf(".");
if(i >= 0) path = path.substring(0,i);
return path + newExtension;
} 
{code}


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to