diff --git a/classes/Utils.php b/classes/Utils.php index 0899f1340f2c0f290af58d750e8aa9b4a45dda8c..c0dc1d6870553c2bc330064f9f2482d03255d66d 100644 --- a/classes/Utils.php +++ b/classes/Utils.php @@ -84,7 +84,8 @@ class Utils{ $row[$k]['value'] = $v['value']; if($v['type'] == 'uri'){ $row[$k]['curie'] = Utils::uri2curie($v['value']); - $row[$k]['localname'] = array_pop(explode(":",$row[$k]['curie'])); + $exploded = explode(":",$row[$k]['curie']); + $row[$k]['localname'] = array_pop($exploded); $row[$k]['uri'] = 1; }elseif($v['type'] == 'bnode'){ $row[$k]['curie'] = 'blankNode'; diff --git a/classes/modules/serviceModule.php b/classes/modules/serviceModule.php index 044ef11ae7c07357356edb40410fc584900a590e..abee954d36bab46192cda0f4124d3664ea7b866c 100644 --- a/classes/modules/serviceModule.php +++ b/classes/modules/serviceModule.php @@ -50,7 +50,7 @@ class ServiceModule extends abstractModule{ $lodspk['model'] = $conf['home'].$conf['model']['directory'].'/'.$conf['service']['prefix'].'/'.$serviceName.'/'; $lodspk['view'] = $conf['home'].$conf['view']['directory'].'/'.$conf['service']['prefix'].'/'.$serviceName.'/'.$extension.'.template'; }else{ - if($lodspk['model'] == null && $lodspk['view'] == null){ + if(is_null($lodspk['model']) && is_null($lodspk['view'])){ //checking other components if(sizeof($conf['components']['services'])>0){ foreach($conf['components']['services'] as $service){ diff --git a/classes/modules/uriModule.php b/classes/modules/uriModule.php index 520a044d2e0e18f51e52d9b865ad4b5b0e421cad..ffdc7f3af630fb7f7e31c7c2c192f3abb5ee83c2 100644 --- a/classes/modules/uriModule.php +++ b/classes/modules/uriModule.php @@ -21,8 +21,8 @@ class UriModule extends abstractModule{ $pair = Queries::getMetadata($localUri, $acceptContentType, $metaDb); #Stripping html to look up and write correct url in database if not exists #Fix to handle pages that have not been loaded after cleaning out database - $localUri_stripped = preg_replace("^(.+)\.html", "\\1", $localUri); - $uri_stripped = preg_replace("^(.+)\.html", "\\1", $uri); + $localUri_stripped = preg_replace("^(.+)\.html$", "\\1", $localUri); + $uri_stripped = preg_replace("^(.+)\.html$", "\\1", $uri); if($pair == NULL){ // Original URI is not in metadata if(Queries::uriExist($uri_stripped, $endpoints['local'])){ $page = Queries::createPage($uri_stripped, $localUri_stripped, $acceptContentType, $metaDb); diff --git a/lib/Haanga/lib/Haanga.php b/lib/Haanga/lib/Haanga.php index bc52e3c79e52348ad9293e9608e2af1503d01b0e..6232fa13c6565807f317e65d6c1d4af95a821bb5 100644 --- a/lib/Haanga/lib/Haanga.php +++ b/lib/Haanga/lib/Haanga.php @@ -136,7 +136,7 @@ class Haanga } break; default: - continue; + continue 2; } } } diff --git a/lib/Haanga/lib/Haanga/Compiler/Tokenizer.php b/lib/Haanga/lib/Haanga/Compiler/Tokenizer.php index 3448562c5b145cfba28d9207d91db05639d7f2cb..5dad9f1ab04594c290e910ddb41a5ef40b3af112 100644 --- a/lib/Haanga/lib/Haanga/Compiler/Tokenizer.php +++ b/lib/Haanga/lib/Haanga/Compiler/Tokenizer.php @@ -435,7 +435,7 @@ class Haanga_Compiler_Tokenizer case 0: // match if (isset($data[$len]) && !$this->is_token_end($data[$len])) { /* probably a variable name TRUEfoo (and not TRUE) */ - continue; + continue 2; } $this->token = $token; $this->value = $value; @@ -558,7 +558,7 @@ class Haanga_Compiler_Tokenizer static function init($template, $compiler, $file='') { $lexer = new Haanga_Compiler_Tokenizer($template, $compiler, $file); - file_put_contents('/var/www/sites/katalogskeivtarkiv/tmp/foo.php', $file . "\n", FILE_APPEND); + file_put_contents('/var/www/html/marcus-prod/cache/foo.php', $file . "\n", FILE_APPEND); $parser = new Haanga_Compiler_Parser($lexer, $file); $parser->compiler = $compiler; diff --git a/lib/Haanga/lib/Haanga/Loader.php b/lib/Haanga/lib/Haanga/Loader.php index d95d5aa867f5749f0c4f9ff0fdd1654e689fb882..434162113cb5ba5a6562d8ba79b4211352de3674 100644 --- a/lib/Haanga/lib/Haanga/Loader.php +++ b/lib/Haanga/lib/Haanga/Loader.php @@ -62,6 +62,7 @@ spl_autoload_register(function ($class) { 'haanga_extension_filter_slugify' => '/Extension/Filter/Slugify.php', 'haanga_extension_filter_decodedescription' => '/Extension/Filter/Decodedescription.php', 'haanga_extension_filter_deurifier' => '/Extension/Filter/Deurifier.php', + 'haanga_extension_filter_striptags' => '/Extension/Filter/Striptags.php', 'haanga_extension_tag' => '/Extension/Tag.php',