-
Notifications
You must be signed in to change notification settings - Fork 51
Conversation
39d59ca
to
d4934ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording of the error message should be improved. Further it would be good to implement the fix in Erfurt and catch the according exception here.
Please also check at which level OntoWiki is already catching such Exceptions.
@@ -511,6 +511,10 @@ public function createAction() | |||
); | |||
$this->view->errorFlag = true; | |||
return; | |||
} else if (!Erfurt_Uri::check($newModelUri)) { | |||
$this->_owApp->appendMessage( | |||
new OntoWiki_Message('The given String is no legal URI (http://...)', OntoWiki_Message::ERROR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hint "http://…" connotes, that the algorithm already identified the missing protocol part, while there might be other cases for the value not being a valid URI or IRI.
@@ -511,6 +511,10 @@ public function createAction() | |||
); | |||
$this->view->errorFlag = true; | |||
return; | |||
} else if (!Erfurt_Uri::check($newModelUri)) { | |||
$this->_owApp->appendMessage( | |||
new OntoWiki_Message('The given String is no legal URI (http://...)', OntoWiki_Message::ERROR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"String" is a very technical term in this case, better use "value"
@@ -511,6 +511,10 @@ public function createAction() | |||
); | |||
$this->view->errorFlag = true; | |||
return; | |||
} else if (!Erfurt_Uri::check($newModelUri)) { | |||
$this->_owApp->appendMessage( | |||
new OntoWiki_Message('The given String is no legal URI (http://...)', OntoWiki_Message::ERROR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are aiming for IRI support, it is better to write IRI or URI (resp. other way round)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also check if the check supports IRIs
d4934ba
to
0830280
Compare
done in AKSW/Erfurt#129 --- is the error message ok? |
0830280
to
28861fc
Compare
now uses error codes to check if the exception gets catched or not |
28861fc
to
4f0081d
Compare
Do URNs (urn:…) and https:// URI still work? |
are urn:'s really valid RDF/Modelnames? *edit |
4f0081d
to
b42a80f
Compare
What about ftp://… and tel:… I think there are more valid kinds of URIs resp. IRIs and afaik all of them are allowed for models. https://tools.ietf.org/html/rfc3986 https://en.wikipedia.org/wiki/Uniform_Resource_Identifier |
b42a80f
to
5c3ae49
Compare
We are now using the PHP filter |
Could you add the test? |
faa4e24
to
aebe011
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally please rebase and squash the commits.
['urn:oasis:names:specification:docbook:dtd:xml:4.1.2', true], | ||
['https://www.aksw.org/faq', true], | ||
['ptth://www.aksw.org', true], | ||
['\\äüö', false] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some more failing examples
public function testCreateActionFiltersOnlyIncorrectUris($uri, $correctUri) | ||
{ | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also check the coding standard with code sniffer
b7a6132
to
99d1b39
Compare
new OntoWiki_Message( | ||
'Given Knowledge Base already exists.', | ||
OntoWiki_Message::ERROR | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you touch this twice?
@@ -2,7 +2,7 @@ | |||
/** | |||
* This file is part of the {@link http://ontowiki.net OntoWiki} project. | |||
* | |||
* @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW} | |||
* @copyright Copyright (c) 2006-2017, {@link http://aksw.org AKSW} | |||
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can go to the first commit.
adds a test for the filter and adds frontendlogin into the ControllerTestCase.php
99d1b39
to
d28de85
Compare
Done @white-gecko |
This fix checks the URI for knowledge base creation for http://
This Pull Request does fix #399